• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂9f9868f11316f860bf3a83e0faa50023ddbbb1d7 (tree)
時間2021-11-28 22:34:30
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2525 Convert QueryString by PageURIHandler

Change Summary

差異

--- a/lib/func.php
+++ b/lib/func.php
@@ -1178,6 +1178,10 @@ function get_preg_u() {
11781178 }
11791179
11801180 class PukiWikiStandardPageURIHandler {
1181+ function filter_raw_query_string($query_string) {
1182+ return $query_string;
1183+ }
1184+
11811185 function get_page_uri_fragment($page) {
11821186 return '?' . pagename_urlencode($page);
11831187 }
--- a/lib/init.php
+++ b/lib/init.php
@@ -295,6 +295,21 @@ if (PKWK_QUERY_STRING_MAX && strlen($arg) > PKWK_QUERY_STRING_MAX) {
295295 }
296296 $arg = input_filter($arg); // \0 除去
297297
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+
298313 // unset QUERY_STRINGs
299314 foreach (array('QUERY_STRING', 'argv', 'argc') as $key) {
300315 unset(${$key}, $_SERVER[$key], $HTTP_SERVER_VARS[$key]);