1 scm checkins which happen to produce plus sign after base64_encode get decoded
2 as garbage as plus sign in url means space. and then the data can't be decoded
3 back to original string.
5 $ php -r 'echo base64_encode("pood >qwertyuiopadsfzkq1"), "\n";'
6 cG9vZCA+cXdlcnR5dWlvcGFkc2Z6a3Ex
7 $ php -r 'echo base64_decode("cG9vZCA+cXdlcnR5dWlvcGFkc2Z6a3Ex"), "\n";'
8 pood >qwertyuiopadsfzkq1
9 $ php -r 'echo base64_decode("cG9vZCA cXdlcnR5dWlvcGFkc2Z6a3Ex"), "\n";'
12 --- eventum-20060318/misc/scm/process_cvs_commits.php~ 2006-03-24 17:57:19.000000000 +0200
13 +++ eventum-20060318/misc/scm/process_cvs_commits.php 2006-03-24 17:57:01.000000000 +0200
16 if (count($matches) > 1) {
17 // need to encode all of the url arguments
18 - $issue_id = base64_encode($matches[1]);
19 - $commit_msg = base64_encode($commit_msg);
20 - $cvs_module = base64_encode($cvs_module);
21 - $username = base64_encode($username);
22 + $issue_id = rawurlencode($matches[1]);
23 + $commit_msg = rawurlencode($commit_msg);
24 + $cvs_module = rawurlencode($cvs_module);
25 + $username = rawurlencode($username);
27 // build the GET url to use
28 $ping_url = $eventum_relative_url . "scm_ping.php?module=$cvs_module&username=$username&commit_msg=$commit_msg";
29 $ping_url .= "&issue[]=$issue_id";
30 for ($i = 0; $i < count($modified_files); $i++) {
31 - $ping_url .= "&files[$i]=" . base64_encode($modified_files[$i]['filename']);
32 - $ping_url .= "&old_versions[$i]=" . base64_encode($modified_files[$i]['old_revision']);
33 - $ping_url .= "&new_versions[$i]=" . base64_encode($modified_files[$i]['new_revision']);
34 + $ping_url .= "&files[$i]=" . rawurlencode($modified_files[$i]['filename']);
35 + $ping_url .= "&old_versions[$i]=" . rawurlencode($modified_files[$i]['old_revision']);
36 + $ping_url .= "&new_versions[$i]=" . rawurlencode($modified_files[$i]['new_revision']);
39 $fp = fsockopen($eventum_domain, $eventum_port, $errno, $errstr, 30);
40 --- eventum-20060318/scm_ping.php~ 2006-03-24 17:57:20.000000000 +0200
41 +++ eventum-20060318/scm_ping.php 2006-03-24 17:57:01.000000000 +0200
43 include_once(APP_INC_PATH . "class.workflow.php");
44 include_once(APP_INC_PATH . "db_access.php");
46 -$HTTP_GET_VARS = Misc::array_map_deep($HTTP_GET_VARS, 'base64_decode');
48 foreach ($HTTP_GET_VARS['issue'] as $issue_id) {
50 for ($y = 0; $y < count($HTTP_GET_VARS['files']); $y++) {