From 8ed10a962338dacc357d1aee6eb1d70729b9f4b6 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 30 May 2006 04:29:49 +0000 Subject: [PATCH] fixed some errors git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3550 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/helpviewer.php | 5 ++--- include/functions_helpviewer.inc | 17 ++++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/html/helpviewer.php b/html/helpviewer.php index dddf0cd8b..c463c63ed 100644 --- a/html/helpviewer.php +++ b/html/helpviewer.php @@ -94,7 +94,7 @@ $backward =$defaultpage; $index =$defaultpage; $forward ="node1.html"; - +$helpdir =""; /* Every class which is called within a tab, stores its name in the Session. * If $_SESSION['current_class_for_help'] isset, * get the helpfile specified in the xml file and display it. @@ -109,7 +109,7 @@ if(isset($_SESSION['current_class_for_help'])){ $str = $xml->parse(); /* __LANG__ is used as placeholder for the used language*/ - $helpdir= preg_replace("/__LANG__/i",$lang,$str[($_SESSION['current_class_for_help'])]['PATH']); + $helpdir= @preg_replace("/__LANG__/i",$lang,$str[($_SESSION['current_class_for_help'])]['PATH']); /* If there is no entry in the xml file for this class, display an error message */ if($helpdir == ""){ @@ -171,7 +171,6 @@ if(isset($_GET['pg'])){ } } } - $helpdir.="/"; /* Save current settings */ diff --git a/include/functions_helpviewer.inc b/include/functions_helpviewer.inc index 44938a19b..874f24b3f 100644 --- a/include/functions_helpviewer.inc +++ b/include/functions_helpviewer.inc @@ -49,7 +49,7 @@ class parseXml } function tag_open($parser,$tag,$attrs) { - $this->entries[$attrs['NAME']]=$attrs; + @$this->entries[$attrs['NAME']]=$attrs; } function tag_close(){; } @@ -314,7 +314,7 @@ function search($arr,$word) /* Filter in Tag results*/ if(count($matches[0])){ foreach($matches[0] as $num=>$hit){ - if(is_in_tag($arr[$key]['content'],$hit[1])) { + if(isset($arr[$key]['content']) && (is_in_tag($arr[$key]['content'],$hit[1]))){ unset($matches[0][$num]); } } @@ -382,9 +382,8 @@ function searchlist($arr,$res,$maxresults) /* appending footer message for resultlist */ $ret.= "
- ".sprintf(_("%s results for your search with the keyword %s interpreted as %s"), + ".sprintf(_("%s results for your search with the keyword %s"), "".count($topten)."", - "".($_SESSION['search_string'])."", "".$_SESSION['parsed_search_keyword'].""); $ret.="

"; @@ -473,9 +472,13 @@ function createResultEntry($entry,$res,$name,$max) /*Simple function to detect if we prepare to change a tag or visible text */ function is_in_tag($string,$pos) { - $pos1 = strpos($string,"<",$pos); - $pos2 = strpos($string,">",$pos); - + $pos1 = $pos2 = 0; + if(preg_match("//",$string)){ + $pos2 = strpos($string,">",$pos); + } if ($pos1 > $pos2) { return(true); }else{ -- 2.30.2