SOURCES: eventum-scm-pluscharisbad.patch (NEW) - fix scm commits c...

glen glen at pld-linux.org
Fri Mar 24 17:14:04 CET 2006


Author: glen                         Date: Fri Mar 24 16:14:04 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix scm commits causing garbage in certain commit messages

---- Files affected:
SOURCES:
   eventum-scm-pluscharisbad.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/eventum-scm-pluscharisbad.patch
diff -u /dev/null SOURCES/eventum-scm-pluscharisbad.patch:1.1
--- /dev/null	Fri Mar 24 17:14:04 2006
+++ SOURCES/eventum-scm-pluscharisbad.patch	Fri Mar 24 17:13:59 2006
@@ -0,0 +1,50 @@
+scm checkins which happen to produce plus sign after base64_encode get decoded
+as garbage as plus sign in url means space. and then the data can't be decoded
+back to original string.
+
+$ php -r 'echo base64_encode("pood >qwertyuiopadsfzkq1"), "\n";'
+cG9vZCA+cXdlcnR5dWlvcGFkc2Z6a3Ex
+$ php -r 'echo base64_decode("cG9vZCA+cXdlcnR5dWlvcGFkc2Z6a3Ex"), "\n";'
+pood >qwertyuiopadsfzkq1
+$ php -r 'echo base64_decode("cG9vZCA cXdlcnR5dWlvcGFkc2Z6a3Ex"), "\n";'
+pood ]Ů\]Z[ÜYŮÜL
+
+--- eventum-20060318/misc/scm/process_cvs_commits.php~	2006-03-24 17:57:19.000000000 +0200
++++ eventum-20060318/misc/scm/process_cvs_commits.php	2006-03-24 17:57:01.000000000 +0200
+@@ -71,18 +72,18 @@
+ 
+ if (count($matches) > 1) {
+     // need to encode all of the url arguments
+-    $issue_id = base64_encode($matches[1]);
+-    $commit_msg = base64_encode($commit_msg);
+-    $cvs_module = base64_encode($cvs_module);
+-    $username = base64_encode($username);
++    $issue_id = rawurlencode($matches[1]);
++    $commit_msg = rawurlencode($commit_msg);
++    $cvs_module = rawurlencode($cvs_module);
++    $username = rawurlencode($username);
+ 
+     // build the GET url to use
+     $ping_url = $eventum_relative_url . "scm_ping.php?module=$cvs_module&username=$username&commit_msg=$commit_msg";
+     $ping_url .= "&issue[]=$issue_id";
+     for ($i = 0; $i < count($modified_files); $i++) {
+-        $ping_url .= "&files[$i]=" . base64_encode($modified_files[$i]['filename']);
+-        $ping_url .= "&old_versions[$i]=" . base64_encode($modified_files[$i]['old_revision']);
+-        $ping_url .= "&new_versions[$i]=" . base64_encode($modified_files[$i]['new_revision']);
++        $ping_url .= "&files[$i]=" . rawurlencode($modified_files[$i]['filename']);
++        $ping_url .= "&old_versions[$i]=" . rawurlencode($modified_files[$i]['old_revision']);
++        $ping_url .= "&new_versions[$i]=" . rawurlencode($modified_files[$i]['new_revision']);
+     }
+ 
+     $fp = fsockopen($eventum_domain, $eventum_port, $errno, $errstr, 30);
+--- eventum-20060318/scm_ping.php~	2006-03-24 17:57:20.000000000 +0200
++++ eventum-20060318/scm_ping.php	2006-03-24 17:57:01.000000000 +0200
+@@ -33,8 +33,6 @@
+ include_once(APP_INC_PATH . "class.workflow.php");
+ include_once(APP_INC_PATH . "db_access.php");
+ 
+-$HTTP_GET_VARS = Misc::array_map_deep($HTTP_GET_VARS, 'base64_decode');
+-
+ foreach ($HTTP_GET_VARS['issue'] as $issue_id) {
+     $files = array();
+     for ($y = 0; $y < count($HTTP_GET_VARS['files']); $y++) {
================================================================


More information about the pld-cvs-commit mailing list