From dbf714f723aaf3a4e63a0ac2f07746c41fa3e98d Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 18 Feb 2014 13:34:22 +0100 Subject: Improve PHPDocs pageutils --- inc/pageutils.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index c8d3cf4bb..9c2794387 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -94,6 +94,7 @@ function getID($param='id',$clean=true){ * @author Andreas Gohr * @param string $raw_id The pageid to clean * @param boolean $ascii Force ASCII + * @return string cleaned id */ function cleanID($raw_id,$ascii=false){ global $conf; @@ -244,6 +245,7 @@ function page_exists($id,$rev='',$clean=true) { * @param $rev string page revision, empty string for current * @param $clean bool flag indicating that $raw_id should be cleaned. Only set to false * when $id is guaranteed to have been cleaned already. + * @return string full path * * @author Andreas Gohr */ @@ -361,6 +363,7 @@ function mediaFN($id, $rev=''){ * * @param string $id The id of the local file * @param string $ext The file extension (usually txt) + * @return string full filepath to localized file * @author Andreas Gohr */ function localeFN($id,$ext='txt'){ @@ -543,6 +546,11 @@ function isHiddenPage($id){ return $data['hidden']; } +/** + * callback checks if page is hidden + * + * @param array $data event data see isHiddenPage() + */ function _isHiddenPage(&$data) { global $conf; global $ACT; -- cgit v1.2.3 From 4cd9f7913e21f3115fb7ff8d8820473613a39576 Mon Sep 17 00:00:00 2001 From: lisps Date: Thu, 20 Feb 2014 23:19:45 +0100 Subject: check link existence --- inc/pageutils.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index c8d3cf4bb..20fe54a8e 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -432,9 +432,9 @@ function resolve_id($ns,$id,$clean=true){ * * @author Andreas Gohr */ -function resolve_mediaid($ns,&$page,&$exists){ +function resolve_mediaid($ns,&$page,&$exists,$rev='' ){ $page = resolve_id($ns,$page); - $file = mediaFN($page); + $file = mediaFN($page,$rev); $exists = @file_exists($file); } @@ -443,7 +443,7 @@ function resolve_mediaid($ns,&$page,&$exists){ * * @author Andreas Gohr */ -function resolve_pageid($ns,&$page,&$exists){ +function resolve_pageid($ns,&$page,&$exists,$rev='' ){ global $conf; global $ID; $exists = false; @@ -463,20 +463,20 @@ function resolve_pageid($ns,&$page,&$exists){ $page = resolve_id($ns,$page,false); // resolve but don't clean, yet // get filename (calls clean itself) - $file = wikiFN($page); + $file = wikiFN($page,$rev); // if ends with colon or slash we have a namespace link if(in_array(substr($page,-1), array(':', ';')) || ($conf['useslash'] && substr($page,-1) == '/')){ - if(page_exists($page.$conf['start'])){ + if(page_exists($page.$conf['start'],$rev)){ // start page inside namespace $page = $page.$conf['start']; $exists = true; - }elseif(page_exists($page.noNS(cleanID($page)))){ + }elseif(page_exists($page.noNS(cleanID($page),$rev))){ // page named like the NS inside the NS $page = $page.noNS(cleanID($page)); $exists = true; - }elseif(page_exists($page)){ + }elseif(page_exists($page,$rev)){ // page like namespace exists $page = $page; $exists = true; @@ -493,7 +493,7 @@ function resolve_pageid($ns,&$page,&$exists){ }else{ $try = $page.'s'; } - if(page_exists($try)){ + if(page_exists($try,$rev)){ $page = $try; $exists = true; } -- cgit v1.2.3 From 90bee6003f3d7160fb936d01511a35eeb5bc708c Mon Sep 17 00:00:00 2001 From: lisps Date: Sat, 22 Feb 2014 03:13:10 +0100 Subject: fix check link existence, have to call getLastRevisionAt for every link --- inc/pageutils.php | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 20fe54a8e..4504fdd2b 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -231,7 +231,13 @@ function sectionID($title,&$check) { * * @author Chris Smith */ -function page_exists($id,$rev='',$clean=true) { +function page_exists($id,$rev='',$clean=true, $data_at=false) { + if($rev !== '' && $date_at) { + $pagelog = new PageChangeLog($page); + $pagelog_rev = $pagelog->getLastRevisionAt($rev); + if($pagelog_rev !== false) + $rev = $pagelog_rev; + } return @file_exists(wikiFN($id,$rev,$clean)); } @@ -432,7 +438,14 @@ function resolve_id($ns,$id,$clean=true){ * * @author Andreas Gohr */ -function resolve_mediaid($ns,&$page,&$exists,$rev='' ){ +function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){ + if($rev !== '' && $date_at){ + $medialog = new MediaChangeLog($media_id); + $medialog_rev = $medialog->getLastRevisionAt($rev); + if($medialog_rev !== false) { + $rev = $medialog_rev; + } + } $page = resolve_id($ns,$page); $file = mediaFN($page,$rev); $exists = @file_exists($file); @@ -443,7 +456,7 @@ function resolve_mediaid($ns,&$page,&$exists,$rev='' ){ * * @author Andreas Gohr */ -function resolve_pageid($ns,&$page,&$exists,$rev='' ){ +function resolve_pageid($ns,&$page,&$exists,$rev='',$date_at=false ){ global $conf; global $ID; $exists = false; @@ -463,20 +476,26 @@ function resolve_pageid($ns,&$page,&$exists,$rev='' ){ $page = resolve_id($ns,$page,false); // resolve but don't clean, yet // get filename (calls clean itself) + if($rev !== '' && $date_at) { + $pagelog = new PageChangeLog($page); + $pagelog_rev = $pagelog->getLastRevisionAt($rev); + if($pagelog_rev !== false)//something found + $rev = $pagelog_rev; + } $file = wikiFN($page,$rev); // if ends with colon or slash we have a namespace link if(in_array(substr($page,-1), array(':', ';')) || ($conf['useslash'] && substr($page,-1) == '/')){ - if(page_exists($page.$conf['start'],$rev)){ + if(page_exists($page.$conf['start'],$rev,true,$date_at)){ // start page inside namespace $page = $page.$conf['start']; $exists = true; - }elseif(page_exists($page.noNS(cleanID($page),$rev))){ + }elseif(page_exists($page.noNS(cleanID($page)),$rev,true,$date_at)){ // page named like the NS inside the NS $page = $page.noNS(cleanID($page)); $exists = true; - }elseif(page_exists($page,$rev)){ + }elseif(page_exists($page,$rev,true,$date_at)){ // page like namespace exists $page = $page; $exists = true; @@ -493,7 +512,7 @@ function resolve_pageid($ns,&$page,&$exists,$rev='' ){ }else{ $try = $page.'s'; } - if(page_exists($try,$rev)){ + if(page_exists($try,$rev,true,$date_at)){ $page = $try; $exists = true; } -- cgit v1.2.3 From 585bf44e2b756eac2e1cfce7035ef237bc02a788 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Thu, 6 Mar 2014 19:55:56 +0000 Subject: amend $_SERVER to $INPUT->server --- inc/pageutils.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 9c2794387..8474c5697 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -19,6 +19,7 @@ * @author Andreas Gohr */ function getID($param='id',$clean=true){ + /** @var Input $INPUT */ global $INPUT; global $conf; global $ACT; @@ -27,7 +28,7 @@ function getID($param='id',$clean=true){ //construct page id from request URI if(empty($id) && $conf['userewrite'] == 2){ - $request = $_SERVER['REQUEST_URI']; + $request = $INPUT->server->str('REQUEST_URI'); $script = ''; //get the script URL @@ -36,15 +37,15 @@ function getID($param='id',$clean=true){ if($param != 'id') { $relpath = 'lib/exe/'; } - $script = $conf['basedir'].$relpath.utf8_basename($_SERVER['SCRIPT_FILENAME']); - - }elseif($_SERVER['PATH_INFO']){ - $request = $_SERVER['PATH_INFO']; - }elseif($_SERVER['SCRIPT_NAME']){ - $script = $_SERVER['SCRIPT_NAME']; - }elseif($_SERVER['DOCUMENT_ROOT'] && $_SERVER['SCRIPT_FILENAME']){ - $script = preg_replace ('/^'.preg_quote($_SERVER['DOCUMENT_ROOT'],'/').'/','', - $_SERVER['SCRIPT_FILENAME']); + $script = $conf['basedir'].$relpath.utf8_basename($INPUT->server->str('SCRIPT_FILENAME')); + + }elseif($INPUT->server->str('PATH_INFO')){ + $request = $INPUT->server->str('PATH_INFO'); + }elseif($INPUT->server->str('SCRIPT_NAME')){ + $script = $INPUT->server->str('SCRIPT_NAME'); + }elseif($INPUT->server->str('DOCUMENT_ROOT') && $INPUT->server->str('SCRIPT_FILENAME')){ + $script = preg_replace ('/^'.preg_quote($INPUT->server->str('DOCUMENT_ROOT'),'/').'/','', + $INPUT->server->str('SCRIPT_FILENAME')); $script = '/'.$script; } -- cgit v1.2.3 From 15851b98227ebf9671f8f7facd11426a72da6ea6 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 21 May 2014 11:16:33 +0200 Subject: getNS returns empty string instead of false --- inc/pageutils.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 8474c5697..b678aa7c3 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -146,19 +146,25 @@ function cleanID($raw_id,$ascii=false){ * Return namespacepart of a wiki ID * * @author Andreas Gohr + * + * @param string $id + * @return string */ function getNS($id){ $pos = strrpos((string)$id,':'); if($pos!==false){ return substr((string)$id,0,$pos); } - return false; + return ''; } /** * Returns the ID without the namespace * * @author Andreas Gohr + * + * @param string $id + * @return string */ function noNS($id) { $pos = strrpos($id, ':'); -- cgit v1.2.3 From 84657ea239c6b7c08f5e4ffb58170d6521cdbb44 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 21 May 2014 11:17:19 +0200 Subject: PHPdocs pageutils --- inc/pageutils.php | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index b678aa7c3..79b703ddc 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -17,6 +17,10 @@ * If the second parameter is true (default) the ID is cleaned. * * @author Andreas Gohr + * + * @param string $param the $_REQUEST variable name, default 'id' + * @param bool $clean if true, ID is cleaned + * @return mixed|string */ function getID($param='id',$clean=true){ /** @var Input $INPUT */ @@ -179,6 +183,9 @@ function noNS($id) { * Returns the current namespace * * @author Nathan Fritz + * + * @param string $id + * @return string */ function curNS($id) { return noNS(getNS($id)); @@ -188,6 +195,9 @@ function curNS($id) { * Returns the ID without the namespace or current namespace for 'start' pages * * @author Nathan Fritz + * + * @param string $id + * @return string */ function noNSorNS($id) { global $conf; @@ -208,6 +218,7 @@ function noNSorNS($id) { * @param string $title The headline title * @param array|bool $check Existing IDs (title => number) * @return string the title + * * @author Andreas Gohr */ function sectionID($title,&$check) { @@ -238,6 +249,11 @@ function sectionID($title,&$check) { * parameters as for wikiFN * * @author Chris Smith + * + * @param string $id page id + * @param string|int $rev empty or revision timestamp + * @param bool $clean flag indicating that $id should be cleaned (see wikiFN as well) + * @return bool exists? */ function page_exists($id,$rev='',$clean=true) { return @file_exists(wikiFN($id,$rev,$clean)); @@ -296,6 +312,9 @@ function wikiFN($raw_id,$rev='',$clean=true){ * Returns the full path to the file for locking the page while editing. * * @author Ben Coburn + * + * @param string $id page id + * @return string full path */ function wikiLockFN($id) { global $conf; @@ -307,6 +326,10 @@ function wikiLockFN($id) { * returns the full path to the meta file specified by ID and extension * * @author Steven Danz + * + * @param string $id page id + * @param string $ext file extension + * @return string full path */ function metaFN($id,$ext){ global $conf; @@ -320,6 +343,10 @@ function metaFN($id,$ext){ * returns the full path to the media's meta file specified by ID and extension * * @author Kate Arzamastseva + * + * @param string $id media id + * @param string $ext extension of media + * @return string */ function mediaMetaFN($id,$ext){ global $conf; @@ -334,6 +361,9 @@ function mediaMetaFN($id,$ext){ * * @author Esther Brunner * @author Michael Hamann + * + * @param string $id page id + * @return array */ function metaFiles($id){ $basename = metaFN($id, ''); @@ -349,6 +379,10 @@ function metaFiles($id){ * * @author Andreas Gohr * @author Kate Arzamastseva + * + * @param string $id media id + * @param string|int $rev empty string or revision timestamp + * @return string full path */ function mediaFN($id, $rev=''){ global $conf; @@ -371,6 +405,7 @@ function mediaFN($id, $rev=''){ * @param string $id The id of the local file * @param string $ext The file extension (usually txt) * @return string full filepath to localized file + * * @author Andreas Gohr */ function localeFN($id,$ext='txt'){ @@ -396,6 +431,11 @@ function localeFN($id,$ext='txt'){ * http://www.php.net/manual/en/function.realpath.php#57016 * * @author + * + * @param string $ns namespace which is context of id + * @param string $id relative id + * @param bool $clean flag indicating that id should be cleaned + * @return mixed|string */ function resolve_id($ns,$id,$clean=true){ global $conf; @@ -441,6 +481,10 @@ function resolve_id($ns,$id,$clean=true){ * Returns a full media id * * @author Andreas Gohr + * + * @param string $ns namespace which is context of id + * @param string &$page (reference) relative media id, updated to resolved id + * @param bool &$exists (reference) updated with existance of media */ function resolve_mediaid($ns,&$page,&$exists){ $page = resolve_id($ns,$page); @@ -452,6 +496,10 @@ function resolve_mediaid($ns,&$page,&$exists){ * Returns a full page id * * @author Andreas Gohr + * + * @param string $ns namespace which is context of id + * @param string &$page (reference) relative page id, updated to resolved id + * @param bool &$exists (reference) updated with existance of media */ function resolve_pageid($ns,&$page,&$exists){ global $conf; @@ -543,6 +591,9 @@ function getCacheName($data,$ext=''){ * Checks a pageid against $conf['hidepages'] * * @author Andreas Gohr + * + * @param string $id page id + * @return bool */ function isHiddenPage($id){ $data = array( @@ -556,7 +607,7 @@ function isHiddenPage($id){ /** * callback checks if page is hidden * - * @param array $data event data see isHiddenPage() + * @param array $data event data - see isHiddenPage() */ function _isHiddenPage(&$data) { global $conf; @@ -575,6 +626,9 @@ function _isHiddenPage(&$data) { * Reverse of isHiddenPage * * @author Andreas Gohr + * + * @param string $id page id + * @return bool */ function isVisiblePage($id){ return !isHiddenPage($id); @@ -587,8 +641,10 @@ function isVisiblePage($id){ * “*”. Output is escaped. * * @author Adrian Lang + * + * @param string $id page id + * @return string */ - function prettyprint_id($id) { if (!$id || $id === ':') { return '*'; @@ -611,6 +667,10 @@ function prettyprint_id($id) { * * @author Andreas Gohr * @see urlencode + * + * @param string $file file name + * @param bool $safe if true, only encoded when non ASCII characters detected + * @return string */ function utf8_encodeFN($file,$safe=true){ global $conf; @@ -636,6 +696,9 @@ function utf8_encodeFN($file,$safe=true){ * * @author Andreas Gohr * @see urldecode + * + * @param string $file file name + * @return string */ function utf8_decodeFN($file){ global $conf; -- cgit v1.2.3 From ef11fcfcd6213789fb126766301a6ffaf8f83055 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 25 May 2014 11:36:55 +0200 Subject: revert return of getNS to false again --- inc/pageutils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/pageutils.php') 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 * * @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; } /** -- cgit v1.2.3 From 1d053a561daf3b6539283811cc44d39b315e1dbf Mon Sep 17 00:00:00 2001 From: lisps Date: Fri, 26 Sep 2014 13:02:24 +0200 Subject: fix scrutinizer issues --- inc/pageutils.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 9ea75c8aa..49c00d36f 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -255,9 +255,9 @@ function sectionID($title,&$check) { * @param bool $clean flag indicating that $id should be cleaned (see wikiFN as well) * @return bool exists? */ -function page_exists($id,$rev='',$clean=true, $data_at=false) { +function page_exists($id,$rev='',$clean=true, $date_at=false) { if($rev !== '' && $date_at) { - $pagelog = new PageChangeLog($page); + $pagelog = new PageChangeLog($id); $pagelog_rev = $pagelog->getLastRevisionAt($rev); if($pagelog_rev !== false) $rev = $pagelog_rev; @@ -493,14 +493,15 @@ function resolve_id($ns,$id,$clean=true){ * @param bool &$exists (reference) updated with existance of media */ function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){ + $page = resolve_id($ns,$page); if($rev !== '' && $date_at){ - $medialog = new MediaChangeLog($media_id); + $medialog = new MediaChangeLog($page); $medialog_rev = $medialog->getLastRevisionAt($rev); if($medialog_rev !== false) { $rev = $medialog_rev; } } - $page = resolve_id($ns,$page); + $file = mediaFN($page,$rev); $exists = @file_exists($file); } -- cgit v1.2.3 From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 03:34:17 +0200 Subject: scrutinizer documentations issues --- inc/pageutils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 5f62926e4..adfb10cc7 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -265,7 +265,7 @@ function page_exists($id,$rev='',$clean=true) { * The filename is URL encoded to protect Unicode chars * * @param $raw_id string id of wikipage - * @param $rev string page revision, empty string for current + * @param $rev int|string page revision, empty string for current * @param $clean bool flag indicating that $raw_id should be cleaned. Only set to false * when $id is guaranteed to have been cleaned already. * @return string full path -- cgit v1.2.3 From 42ea7f447f39fbc2f79eaaec31f8c10ede59c5d0 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 11:30:27 +0200 Subject: Many PHPDocs, some unused and dyn declared vars many PHPDocs some unused variables some dynamically declared variables declared --- inc/pageutils.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index adfb10cc7..b9c6418e2 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -20,7 +20,7 @@ * * @param string $param the $_REQUEST variable name, default 'id' * @param bool $clean if true, ID is cleaned - * @return mixed|string + * @return string */ function getID($param='id',$clean=true){ /** @var Input $INPUT */ @@ -97,6 +97,7 @@ function getID($param='id',$clean=true){ * converted to unaccented ones * * @author Andreas Gohr + * * @param string $raw_id The pageid to clean * @param boolean $ascii Force ASCII * @return string cleaned id @@ -152,7 +153,7 @@ function cleanID($raw_id,$ascii=false){ * @author Andreas Gohr * * @param string $id - * @return string|bool the namespace part or false if the given ID has no namespace (root) + * @return string|false the namespace part or false if the given ID has no namespace (root) */ function getNS($id){ $pos = strrpos((string)$id,':'); @@ -435,7 +436,7 @@ function localeFN($id,$ext='txt'){ * @param string $ns namespace which is context of id * @param string $id relative id * @param bool $clean flag indicating that id should be cleaned - * @return mixed|string + * @return string */ function resolve_id($ns,$id,$clean=true){ global $conf; @@ -718,6 +719,7 @@ function utf8_decodeFN($file){ * Used for sidebars, but can be used other stuff as well * * @todo add event hook + * * @param string $page the pagename you're looking for * @return string|false the full page id of the found page, false if any */ -- cgit v1.2.3 From 79e79377626799a77c11aa7849cb9c64305590c8 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 7 Jan 2015 10:47:45 +0100 Subject: Remove error supression for file_exists() In an older version of PHP a file_exists() call would issue a warning when the file did not exist. This was fixed in later PHP releases. Since we require PHP 5.3 now, there's no need to supress any error here anymore. This might even give a minor performance boost. --- inc/pageutils.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 2fbcbfd1f..375712661 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -263,7 +263,7 @@ function page_exists($id,$rev='',$clean=true, $date_at=false) { if($pagelog_rev !== false) $rev = $pagelog_rev; } - return @file_exists(wikiFN($id,$rev,$clean)); + return file_exists(wikiFN($id,$rev,$clean)); } /** @@ -299,9 +299,9 @@ function wikiFN($raw_id,$rev='',$clean=true){ $fn = $conf['olddir'].'/'.utf8_encodeFN($id).'.'.$rev.'.txt'; if($conf['compression']){ //test for extensions here, we want to read both compressions - if (@file_exists($fn . '.gz')){ + if (file_exists($fn . '.gz')){ $fn .= '.gz'; - }else if(@file_exists($fn . '.bz2')){ + }else if(file_exists($fn . '.bz2')){ $fn .= '.bz2'; }else{ //file doesnt exist yet, so we take the configured extension @@ -418,9 +418,9 @@ function mediaFN($id, $rev=''){ function localeFN($id,$ext='txt'){ global $conf; $file = DOKU_CONF.'lang/'.$conf['lang'].'/'.$id.'.'.$ext; - if(!@file_exists($file)){ + if(!file_exists($file)){ $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.'.$ext; - if(!@file_exists($file)){ + if(!file_exists($file)){ //fall back to english $file = DOKU_INC.'inc/lang/en/'.$id.'.'.$ext; } @@ -504,7 +504,7 @@ function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){ } $file = mediaFN($page,$rev); - $exists = @file_exists($file); + $exists = file_exists($file); } /** @@ -565,7 +565,7 @@ function resolve_pageid($ns,&$page,&$exists,$rev='',$date_at=false ){ } }else{ //check alternative plural/nonplural form - if(!@file_exists($file)){ + if(!file_exists($file)){ if( $conf['autoplural'] ){ if(substr($page,-1) == 's'){ $try = substr($page,0,-1); -- cgit v1.2.3