リビジョン | 9f9868f11316f860bf3a83e0faa50023ddbbb1d7 (tree) |
---|---|
日時 | 2021-11-28 22:34:30 |
作者 | umorigu <umorigu@gmai...> |
コミッター | umorigu |
BugTrack/2525 Convert QueryString by PageURIHandler
@@ -1178,6 +1178,10 @@ function get_preg_u() { | ||
1178 | 1178 | } |
1179 | 1179 | |
1180 | 1180 | class PukiWikiStandardPageURIHandler { |
1181 | + function filter_raw_query_string($query_string) { | |
1182 | + return $query_string; | |
1183 | + } | |
1184 | + | |
1181 | 1185 | function get_page_uri_fragment($page) { |
1182 | 1186 | return '?' . pagename_urlencode($page); |
1183 | 1187 | } |
@@ -295,6 +295,21 @@ if (PKWK_QUERY_STRING_MAX && strlen($arg) > PKWK_QUERY_STRING_MAX) { | ||
295 | 295 | } |
296 | 296 | $arg = input_filter($arg); // \0 除去 |
297 | 297 | |
298 | +// Convert QueryString by PageURIHandler | |
299 | +$arg_replaced = $pkwk_page_uri_handler->filter_raw_query_string($arg); | |
300 | +if ($arg_replaced !== $arg) { | |
301 | + $_GET = array(); | |
302 | + $m = array(); | |
303 | + foreach (explode('&', $arg_replaced) as $kv) { | |
304 | + if (preg_match('/^([^=]+)(=(.+))?/', $kv, $matches)) { | |
305 | + $_GET[$m[1]] = is_null($m[3]) ? '' : $m[3]; | |
306 | + } | |
307 | + } | |
308 | + unset($m); | |
309 | + $arg = $arg_replaced; | |
310 | +} | |
311 | +unset($arg_replaced); | |
312 | + | |
298 | 313 | // unset QUERY_STRINGs |
299 | 314 | foreach (array('QUERY_STRING', 'argv', 'argc') as $key) { |
300 | 315 | unset(${$key}, $_SERVER[$key], $HTTP_SERVER_VARS[$key]); |