From d98d4540790616b0dc0e1f613e4c217d24038a97 Mon Sep 17 00:00:00 2001 From: Ben Coburn Date: Mon, 10 Jul 2006 13:46:55 +0200 Subject: fixing undefined variables Fixing undefined variable notices and sometimes the underlying error that produced them. darcs-hash:20060710114655-05dcb-073948171847f1f43f153e96c8382abd421da36a.gz --- inc/events.php | 2 +- inc/html.php | 2 ++ inc/parser/xhtml.php | 3 ++- inc/template.php | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/events.php b/inc/events.php index 2e7715352..4563f2c75 100644 --- a/inc/events.php +++ b/inc/events.php @@ -53,7 +53,7 @@ class Doku_Event { function advise_before($enablePreventDefault=true) { global $EVENT_HANDLER; - $this->canPreventDefault = $enablePrevent; + $this->canPreventDefault = $enablePreventDefault; $EVENT_HANDLER->process_event($this,'BEFORE'); return (!$enablePreventDefault || $this->_default); diff --git a/inc/html.php b/inc/html.php index 8906491ef..9fed619a8 100644 --- a/inc/html.php +++ b/inc/html.php @@ -623,6 +623,7 @@ function html_index($ns){ * @author Andreas Gohr */ function html_list_index($item){ + global $ID; $ret = ''; $base = ':'.$item['id']; $base = substr($base,strrpos($base,':')+1); @@ -1014,6 +1015,7 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed? if($wr){ if ($REV) print p_locale_xhtml('editrev'); print p_locale_xhtml($include); + $ro=false; }else{ // check pseudo action 'source' if(!actionOK('source')){ diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index d7a9a1ef4..9518cd12e 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -721,6 +721,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $link['suf'] = ''; $link['more'] = ''; $link['target'] = $conf['target']['media']; + $noLink = false; $link['title'] = $this->_xmlEntities($src); list($ext,$mime) = mimetype($src); @@ -760,7 +761,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $link['title'] = $this->_xmlEntities($src); $link['url'] = ml($src,array('cache'=>$cache)); $link['name'] = $this->_media ($src, $title, $align, $width, $height, $cache); - + $noLink = false; list($ext,$mime) = mimetype($src); if(substr($mime,0,5) == 'image'){ diff --git a/inc/template.php b/inc/template.php index f14472181..ed887d216 100644 --- a/inc/template.php +++ b/inc/template.php @@ -164,6 +164,7 @@ function tpl_admin(){ */ function tpl_metaheaders($alt=true){ global $ID; + global $REV; global $INFO; global $ACT; global $lang; @@ -291,6 +292,7 @@ function tpl_getparent($id){ function tpl_button($type){ global $ACT; global $ID; + global $REV; global $NS; global $INFO; global $conf; @@ -604,7 +606,7 @@ function tpl_youarehere($sep=' » '){ } // print current page, skipping start page, skipping for namespace index - if($page == $part.$parts[$i]) return; + if(isset($page) && $page==$part.$parts[$i]) return; $page = $part.$parts[$i]; if($page == $conf['start']) return; echo $sep; -- cgit v1.2.3