From ef11fcfcd6213789fb126766301a6ffaf8f83055 Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Sun, 25 May 2014 11:36:55 +0200 Subject: [PATCH] revert return of getNS to false again --- inc/io.php | 2 +- inc/pageutils.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/io.php b/inc/io.php index dce676bbb..27a34b045 100644 --- a/inc/io.php +++ b/inc/io.php @@ -31,7 +31,7 @@ function io_sweepNS($id,$basedir='datadir'){ $delone = false; //scan all namespaces - while(($id = getNS($id)) !== ''){ + while(($id = getNS($id)) !== false){ $dir = $conf[$basedir].'/'.utf8_encodeFN(str_replace(':','/',$id)); //try to delete dir else return diff --git a/inc/pageutils.php b/inc/pageutils.php index 79b703ddc..5f62926e4 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -152,14 +152,14 @@ function cleanID($raw_id,$ascii=false){ * @author Andreas Gohr <andi@splitbrain.org> * * @param string $id - * @return string + * @return string|bool the namespace part or false if the given ID has no namespace (root) */ function getNS($id){ $pos = strrpos((string)$id,':'); if($pos!==false){ return substr((string)$id,0,$pos); } - return ''; + return false; } /** -- GitLab