# HG changeset patch # User Matti Hamalainen # Date 1464970682 -10800 # Node ID ce5509f09992578ef415923b44fcc7c881949ae4 # Parent f8a77f25dad6a250afa8224b9096d4f6e9c622c2 Fix certain GET parameter parsing cases to decode URL encoding properly. diff -r f8a77f25dad6 -r ce5509f09992 index.php --- a/index.php Fri Jan 15 18:10:23 2016 +0200 +++ b/index.php Fri Jun 03 19:18:02 2016 +0300 @@ -49,9 +49,10 @@ } return $res; } + $values = trim(urldecode($values)); // Assume string, parse it - if (($list = preg_split("/\s*,\s*/", trim($values), -1, PREG_SPLIT_NO_EMPTY)) === FALSE) + if (($list = preg_split("/\s*,\s*/", $values, -1, PREG_SPLIT_NO_EMPTY)) === FALSE) return $res; if ($pair) @@ -59,7 +60,7 @@ // Parse key-value pairs separated by : foreach ($list as $str) { - if (($tmp = preg_split("/\s*:\s*/", trim($str), -1, PREG_SPLIT_NO_EMPTY)) !== FALSE) + if (($tmp = preg_split("/\s*:\s*/", $str, -1, PREG_SPLIT_NO_EMPTY)) !== FALSE) $res[$tmp[0]] = $tmp[1]; } }