diff --git a/src/index.php b/src/index.php
index fd5136d..4c174a9 100644
--- a/src/index.php
+++ b/src/index.php
@@ -7,7 +7,8 @@ function init() {
// into $appPath example: '/slim-wiki'
// and $requestPathArray example: array('myfolder', 'mypage')
- $uriPathArray = explode("/", parse_url($_SERVER['REQUEST_URI'])['path']);
+ $uriParts = parse_url($_SERVER['REQUEST_URI']);
+ $uriPathArray = explode("/", $uriParts['path']);
$scriptPathArray = explode("/", dirname($_SERVER['SCRIPT_NAME']));
$basePathArray = array();
@@ -36,7 +37,7 @@ function init() {
require_once __DIR__ . '/server/logic/Main.php';
- Main::get()->dispatch($baseUrl, $basePath, $requestPathArray);
+ Main::get()->dispatch($baseUrl, $basePath, $requestPathArray, $uriParts['query']);
}
init();
diff --git a/src/server/layout/page.php b/src/server/layout/page.php
index 9163c1d..4b932db 100644
--- a/src/server/layout/page.php
+++ b/src/server/layout/page.php
@@ -46,7 +46,7 @@
if ($item['active']) {
echo $item['name'];
} else {
- ?>handlePost($requestPathArray);
} else {
- $this->handleGet($baseUrl, $basePath, $requestPathArray);
+ $this->handleGet($baseUrl, $basePath, $requestPathArray, $requestQuery);
}
}
@@ -71,11 +72,8 @@ class Main {
}
}
- private function handleGet($baseUrl, $basePath, $requestPathArray) {
- $isEditMode = isset($requestPathArray[0]) && $requestPathArray[0] == 'edit';
- if ($isEditMode) {
- array_shift($requestPathArray);
- }
+ private function handleGet($baseUrl, $basePath, $requestPathArray, $requestQuery) {
+ $isEditMode = $requestQuery == 'edit';
$articleFilename = $this->getArticleFilename($requestPathArray);
if ($articleFilename == null) {