File: 0004-Ruby-3-fix-escaping-values.patch

package info (click to toggle)
schleuder-cli 0.1.0-4%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 264 kB
  • sloc: ruby: 571; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 1,271 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: Ruby 3: fix escaping values
Origin: https://0xacab.org/schleuder/schleuder-cli/-/commit/68754cf94cc2d9b2a400ff19d2e48a7ffa2ec1f2
Reviewed-by: Georg Faerber <georg@debian.org>
Last-Update: 2023-07-10
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: schleuder-cli/lib/schleuder-cli.rb
===================================================================
--- schleuder-cli.orig/lib/schleuder-cli.rb	2023-07-10 15:42:53.037304520 +0000
+++ schleuder-cli/lib/schleuder-cli.rb	2023-07-10 15:42:53.029303960 +0000
@@ -3,6 +3,7 @@
 require 'pathname'
 require 'net/https'
 require 'uri'
+require 'cgi'
 require 'singleton'
 require 'yaml'
 require 'base64'
Index: schleuder-cli/lib/schleuder-cli/helper.rb
===================================================================
--- schleuder-cli.orig/lib/schleuder-cli/helper.rb	2023-07-10 15:42:53.037304520 +0000
+++ schleuder-cli/lib/schleuder-cli/helper.rb	2023-07-10 15:42:53.029303960 +0000
@@ -19,7 +19,7 @@
       u = "/#{args.join('/')}.json"
       if params
         paramstring  = params.map do |k,v|
-          "#{URI.escape(k.to_s)}=#{URI.escape(v.to_s)}"
+          "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}"
         end.join('&')
         u << "?#{paramstring}"
       end