summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2015-01-07 10:47:45 +0100
committerAndreas Gohr <gohr@cosmocode.de>2015-01-07 10:47:45 +0100
commit79e79377626799a77c11aa7849cb9c64305590c8 (patch)
tree0d359f6b0985fd29f2c854d232578881e636b8c1 /inc/pageutils.php
parentcb339ea7ee2b684b0fd0fb948681c66b76a0b4e1 (diff)
downloadrpg-79e79377626799a77c11aa7849cb9c64305590c8.tar.gz
rpg-79e79377626799a77c11aa7849cb9c64305590c8.tar.bz2
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.
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php14
1 files changed, 7 insertions, 7 deletions
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);