diff options
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r-- | inc/pageutils.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php index 5e741c491..ca4936a82 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -35,7 +35,7 @@ function getID($param='id',$clean=true){ if($param != 'id') { $relpath = 'lib/exe/'; } - $script = $conf['basedir'].$relpath.basename($_SERVER['SCRIPT_FILENAME']); + $script = $conf['basedir'].$relpath.utf8_basename($_SERVER['SCRIPT_FILENAME']); }elseif($_SERVER['PATH_INFO']){ $request = $_SERVER['PATH_INFO']; @@ -115,11 +115,10 @@ function cleanID($raw_id,$ascii=false,$media=false){ $id = utf8_strtolower($id); //alternative namespace seperator - $id = strtr($id,';',':'); if($conf['useslash']){ - $id = strtr($id,'/',':'); + $id = strtr($id,';/','::'); }else{ - $id = strtr($id,'/',$sepchar); + $id = strtr($id,';/',':'.$sepchar); } if($conf['deaccent'] == 2 || $ascii) $id = utf8_romanize($id); @@ -199,7 +198,8 @@ function noNSorNS($id) { * Creates a XHTML valid linkid from a given headline title * * @param string $title The headline title - * @param array $check Existing IDs (title => number) + * @param array|bool $check Existing IDs (title => number) + * @return string the title * @author Andreas Gohr <andi@splitbrain.org> */ function sectionID($title,&$check) { @@ -535,15 +535,25 @@ function getCacheName($data,$ext=''){ * @author Andreas Gohr <gohr@cosmocode.de> */ function isHiddenPage($id){ + $data = array( + 'id' => $id, + 'hidden' => false + ); + trigger_event('PAGEUTILS_ID_HIDEPAGE', $data, '_isHiddenPage'); + return $data['hidden']; +} + +function _isHiddenPage(&$data) { global $conf; global $ACT; - if(empty($conf['hidepages'])) return false; - if($ACT == 'admin') return false; - if(preg_match('/'.$conf['hidepages'].'/ui',':'.$id)){ - return true; + if ($data['hidden']) return; + if(empty($conf['hidepages'])) return; + if($ACT == 'admin') return; + + if(preg_match('/'.$conf['hidepages'].'/ui',':'.$data['id'])){ + $data['hidden'] = true; } - return false; } /** @@ -634,6 +644,7 @@ function utf8_decodeFN($file){ * @return string|false the full page id of the found page, false if any */ function page_findnearest($page){ + if (!$page) return false; global $ID; $ns = $ID; |