OSDN Git Service

Support simple page name expression with '&'-params as query string
authorumorigu <umorigu@gmail.com>
Sun, 12 Jul 2015 14:43:45 +0000 (23:43 +0900)
committerumorigu <umorigu@gmail.com>
Wed, 20 Jan 2016 17:31:11 +0000 (02:31 +0900)
For example, a URL "/?FrontPage&a=b&c=d" is recognized as "FrontPage"
page with a=b and c=d parammeteers.

lib/init.php

index 2561fc8..4224b0f 100644 (file)
@@ -354,6 +354,7 @@ if (! isset($vars['cmd']) && ! isset($vars['plugin'])) {
 
        $get['cmd']  = $post['cmd']  = $vars['cmd']  = 'read';
 
+       $arg = preg_replace("#^([^&]*)&.*$#", "$1", $arg);
        if ($arg == '') $arg = $defaultpage;
        $arg = rawurldecode($arg);
        $arg = strip_bracket($arg);