X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Fnodes.php;h=5e757b5516545f2fd431200bc703d93f33b2dea3;hb=3a3a699727ba9d72a102fae436571666b20b29fb;hp=76d170f899506afe80e385e3ee5533fe70a956a4;hpb=006bd683df7dd016449e114e18508931fb1d90b1;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 76d170f..5e757b5 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 (!) @@ -84,7 +86,7 @@ if ($_SESSION['debugging']) { echo ""; } -if ((isset($_SESSION['user_id']) && ($node['node_creator']==$_SESSION['user_id'])) { +if ((isset($_SESSION['user_id']) && ($node['node_creator']==$_SESSION['user_id']))) { $node['node_permission']='owner'; } @@ -280,7 +282,7 @@ elseif ($transaction) { if ($permissions['r']) { //these 4 lines are not the source of kyberia lagging problems. leave them. started on the 10.4. data gained will be used for scientific purposes -if ($_SESSION['user_id']) { +if ((isset($_SESSION['user_id'])) && ($_SESSION['user_id'])) { $q="insert delayed into levenshtein set user_id='".$_SESSION['user_id']."',node_id='".$node['node_id']."'"; $db->update($q); } @@ -341,7 +343,7 @@ else { //assigning user data to smarty if user logged in -if ($user_id=$_SESSION['user_id']) { +if (isset($_SESSION['user_id'])&($user_id=$_SESSION['user_id'])) { $smarty->assign('_POST',$_POST); $smarty->assign('bookmarks',$_SESSION['bookmarks']); $smarty->assign('ignore',$_SESSION['ignore']); @@ -432,7 +434,7 @@ else { } -if ($node['template_id']!='2019721'){ +if (($node['template_id']!='2019721') & (isset($_SESSION['user_id']))){ //setting user location $q="update users set last_action=NOW(),user_location_vector='".$node['node_vector']."',user_action='".addslashes($node['node_name'])."',user_action_id='".$node['node_id']."' where user_id='".$_SESSION['user_id']."'"; $db->executequery($q); @@ -549,7 +551,7 @@ if ($node['external_link']=='header://svg' && !is_numeric($template_id)) { } //show own header -elseif ($_SESSION['header_id']==true) { +elseif (isset($_SESSION['header_id']) & ($_SESSION['header_id']==true)) { $smarty->assign('header_id',$_SESSION['header_id']); $smarty->template_dir=OWN_TEMPLATE_DIR; $content=$smarty->fetch($_SESSION['header_id'].".tpl");