From: niekt0 Date: Fri, 12 Nov 2010 21:57:06 +0000 (+0100) Subject: Removed some warnings from nodes.php X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=2bcd35a61802802b56fc9703115ff85decf3d461;p=mirrors%2FKyberia-bloodline.git Removed some warnings from nodes.php --- diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 2ace753..40273ea 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -32,8 +32,10 @@ if ($_SESSION['debugging']) { require('config/config.inc'); require(INCLUDE_DIR.'senate.inc'); -preg_match("/id\/(.*)\//",$_SERVER['HTTP_REFERER'],$ref_match); -$referer_id=$ref_match[1]; +if (isset($_SERVER['HTTP_REFERER'])) { + preg_match("/id\/([0-9]*)\//",$_SERVER['HTTP_REFERER'],$ref_match); + $referer_id=$ref_match[1]; +} //connecting to database and creating universal $db object require(INCLUDE_DIR.'log.inc'); @@ -54,7 +56,7 @@ if (!empty($_GET['node_name'])) { $node = nodes::redirByName($_GET['node_name']); } elseif (!empty($_GET['node_id'])) { - $node = nodes::getNodeById($_GET['node_id'],$_SESSION['user_id']); + $node = nodes::getNodeById($_GET['node_id'],isset($_SESSION['user_id']))?$_SESSION['user_id']:''); } //XXX Paths are wrong (!)