From: Daniel Hromada Date: Wed, 26 Jan 2011 22:19:43 +0000 (+0100) Subject: gettin rid of one nonaesthetic warning message & making possible to use base36 templa... X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=5996a28e19d37044d1b74b104f3a9b1c2d277008;p=mirrors%2FKyberia-bloodline.git gettin rid of one nonaesthetic warning message & making possible to use base36 template_ids --- diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index cffb9d0..0c38023 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -42,13 +42,13 @@ $db = new CLASS_DATABASE(); if (preg_match('/id\/([0-9]+)(?:\/([0-9]+)\/?)?/',$_SERVER['PATH_INFO'],$match)) { // print_r($match); $_GET['node_id']=$match[1]; - if ($match[2]) { + if (!empty($match[2])) { $_GET['template_id']=$match[2]; } -} elseif (preg_match('/k\/([a-z0-9]+)(?:\/([0-9]+))?/',$_SERVER['PATH_INFO'],$match)) { +} elseif (preg_match('/k\/([a-z0-9]{1,7})(?:\/([a-z0-9]{1,7}))?/',$_SERVER['PATH_INFO'],$match)) { $_GET['node_id']=base_convert($match[1], 36, 10); - if ($match[2]) { - $_GET['template_id']=$match[2]; + if (!empty($match[2])) { + $_GET['template_id']=base_convert($match[2],36,10); } } elseif (preg_match('/name\/(.*?)\/?$/',$_SERVER['PATH_INFO'],$match)) { $_GET['node_id'] = nodes::getNodeIdByName($match[1]);