From 20b73641f851cc13883ae5496c790901638f625e Mon Sep 17 00:00:00 2001 From: Harvie Date: Mon, 29 Nov 2010 00:00:36 +0100 Subject: [PATCH] Improved PATH_INFO support :-) --- wwwroot/nodes.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 69e867d..a6b0620 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -33,7 +33,7 @@ if ($_SESSION['debugging']) { @$PATH_INFO=trim($_SERVER[PATH_INFO]); if($PATH_INFO != '') { $PATH_CHUNKS = preg_split("/\//", $PATH_INFO); - switch($PATH_CHUNKS[1]) { + if(isset($PATH_CHUNKS[1])) switch($PATH_CHUNKS[1]) { case 'k': if(isset($PATH_CHUNKS[2]) && $PATH_CHUNKS[2] != '') $_GET['node_kid'] = $PATH_CHUNKS[2]; if(isset($PATH_CHUNKS[3]) && $PATH_CHUNKS[3] != '') $_GET['template_kid'] = $PATH_CHUNKS[3]; @@ -42,6 +42,10 @@ if($PATH_INFO != '') { if(isset($PATH_CHUNKS[2]) && $PATH_CHUNKS[2] != '') $_GET['node_id'] = $PATH_CHUNKS[2]; if(isset($PATH_CHUNKS[3]) && $PATH_CHUNKS[3] != '') $_GET['template_id'] = $PATH_CHUNKS[3]; break; + default: + if($PATH_CHUNKS[1] != '') $_GET['node_name'] = $PATH_CHUNKS[1]; + if(isset($PATH_CHUNKS[2]) && $PATH_CHUNKS[2] != '') $_GET['template_kid'] = $PATH_CHUNKS[2]; + break; } } -- 2.30.2