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/JpegMeta.php | 2 +- inc/Sitemapper.php | 2 +- inc/auth.php | 2 +- inc/cache.php | 2 +- inc/changelog.php | 8 ++++---- inc/common.php | 24 ++++++++++++------------ inc/confutils.php | 2 +- inc/fetch.functions.php | 2 +- inc/html.php | 6 +++--- inc/indexer.php | 20 ++++++++++---------- inc/infoutils.php | 12 ++++++------ inc/init.php | 24 ++++++++++++------------ inc/io.php | 12 ++++++------ inc/load.php | 2 +- inc/media.php | 28 ++++++++++++++-------------- inc/pageutils.php | 14 +++++++------- inc/parserutils.php | 10 +++++----- inc/plugin.php | 12 ++++++------ inc/plugincontroller.class.php | 8 ++++---- inc/subscription.php | 2 +- inc/template.php | 12 ++++++------ 21 files changed, 103 insertions(+), 103 deletions(-) (limited to 'inc') diff --git a/inc/JpegMeta.php b/inc/JpegMeta.php index d50bad9b7..4cdebcc36 100644 --- a/inc/JpegMeta.php +++ b/inc/JpegMeta.php @@ -936,7 +936,7 @@ class JpegMeta { if ($fileName == "") { $tmpName = tempnam(dirname($this->_fileName),'_metatemp_'); $this->_writeJPEG($tmpName); - if (@file_exists($tmpName)) { + if (file_exists($tmpName)) { return io_rename($tmpName, $this->_fileName); } } else { diff --git a/inc/Sitemapper.php b/inc/Sitemapper.php index 0325f6d44..037990e96 100644 --- a/inc/Sitemapper.php +++ b/inc/Sitemapper.php @@ -33,7 +33,7 @@ class Sitemapper { $sitemap = Sitemapper::getFilePath(); - if(@file_exists($sitemap)){ + if(file_exists($sitemap)){ if(!is_writable($sitemap)) return false; }else{ if(!is_writable(dirname($sitemap))) return false; diff --git a/inc/auth.php b/inc/auth.php index d51534e67..17923ba2a 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -1189,7 +1189,7 @@ function act_resendpwd() { // we're in token phase - get user info from token $tfile = $conf['cachedir'].'/'.$token{0}.'/'.$token.'.pwauth'; - if(!@file_exists($tfile)) { + if(!file_exists($tfile)) { msg($lang['resendpwdbadauth'], -1); $INPUT->remove('pwauth'); return false; diff --git a/inc/cache.php b/inc/cache.php index edf394134..68f64eaa2 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -203,7 +203,7 @@ class cache_parser extends cache { */ public function _useCache() { - if (!@file_exists($this->file)) return false; // source exists? + if (!file_exists($this->file)) return false; // source exists? return parent::_useCache(); } diff --git a/inc/changelog.php b/inc/changelog.php index c2d3cb489..d1ef7973e 100644 --- a/inc/changelog.php +++ b/inc/changelog.php @@ -351,7 +351,7 @@ function _handleRecent($line,$ns,$flags,&$seen){ // check existance if($flags & RECENTS_SKIP_DELETED){ $fn = (($flags & RECENTS_MEDIA_CHANGES) ? mediaFN($recent['id']) : wikiFN($recent['id'])); - if(!@file_exists($fn)) return false; + if(!file_exists($fn)) return false; } return $recent; @@ -498,14 +498,14 @@ abstract class ChangeLog { if($first < 0) { $first = 0; - } else if(@file_exists($this->getFilename())) { + } else if(file_exists($this->getFilename())) { // skip current revision if the page exists $first = max($first + 1, 0); } $file = $this->getChangelogFilename(); - if(!@file_exists($file)) { + if(!file_exists($file)) { return $revs; } if(filesize($file) < $this->chunk_size || $this->chunk_size == 0) { @@ -735,7 +735,7 @@ abstract class ChangeLog { protected function readloglines($rev) { $file = $this->getChangelogFilename(); - if(!@file_exists($file)) { + if(!file_exists($file)) { return false; } diff --git a/inc/common.php b/inc/common.php index 2c9359a0c..9b330000b 100644 --- a/inc/common.php +++ b/inc/common.php @@ -188,7 +188,7 @@ function pageinfo() { $info['locked'] = checklock($ID); $info['filepath'] = fullpath(wikiFN($ID)); - $info['exists'] = @file_exists($info['filepath']); + $info['exists'] = file_exists($info['filepath']); $info['currentrev'] = @filemtime($info['filepath']); if($REV) { //check if current revision was meant @@ -202,7 +202,7 @@ function pageinfo() { } else { //really use old revision $info['filepath'] = fullpath(wikiFN($ID, $REV)); - $info['exists'] = @file_exists($info['filepath']); + $info['exists'] = file_exists($info['filepath']); } } $info['rev'] = $REV; @@ -256,7 +256,7 @@ function pageinfo() { // draft $draft = getCacheName($info['client'].$ID, '.draft'); - if(@file_exists($draft)) { + if(file_exists($draft)) { if(@filemtime($draft) < @filemtime(wikiFN($ID))) { // remove stale draft @unlink($draft); @@ -352,7 +352,7 @@ function breadcrumbs() { $crumbs = isset($_SESSION[DOKU_COOKIE]['bc']) ? $_SESSION[DOKU_COOKIE]['bc'] : array(); //we only save on show and existing wiki documents $file = wikiFN($ID); - if($ACT != 'show' || !@file_exists($file)) { + if($ACT != 'show' || !file_exists($file)) { $_SESSION[DOKU_COOKIE]['bc'] = $crumbs; return $crumbs; } @@ -853,7 +853,7 @@ function checklock($id) { $lock = wikiLockFN($id); //no lockfile - if(!@file_exists($lock)) return false; + if(!file_exists($lock)) return false; //lockfile expired if((time() - filemtime($lock)) > $conf['locktime']) { @@ -907,7 +907,7 @@ function unlock($id) { global $INPUT; $lock = wikiLockFN($id); - if(@file_exists($lock)) { + if(file_exists($lock)) { @list($ip, $session) = explode("\n", io_readFile($lock)); if($ip == $INPUT->server->str('REMOTE_USER') || $ip == clientIP() || $session == session_id()) { @unlink($lock); @@ -1010,13 +1010,13 @@ function pageTemplate($id) { // if the before event did not set a template file, try to find one if(empty($data['tplfile'])) { $path = dirname(wikiFN($id)); - if(@file_exists($path.'/_template.txt')) { + if(file_exists($path.'/_template.txt')) { $data['tplfile'] = $path.'/_template.txt'; } else { // search upper namespaces for templates $len = strlen(rtrim($conf['datadir'], '/')); while(strlen($path) >= $len) { - if(@file_exists($path.'/__template.txt')) { + if(file_exists($path.'/__template.txt')) { $data['tplfile'] = $path.'/__template.txt'; break; } @@ -1197,13 +1197,13 @@ function saveWikiText($id, $text, $summary, $minor = false) { $file = wikiFN($id); $old = @filemtime($file); // from page $wasRemoved = (trim($text) == ''); // check for empty or whitespace only - $wasCreated = !@file_exists($file); + $wasCreated = !file_exists($file); $wasReverted = ($REV == true); $pagelog = new PageChangeLog($id, 1024); $newRev = false; $oldRev = $pagelog->getRevisions(-1, 1); // from changelog $oldRev = (int) (empty($oldRev) ? 0 : $oldRev[0]); - if(!@file_exists(wikiFN($id, $old)) && @file_exists($file) && $old >= $oldRev) { + if(!file_exists(wikiFN($id, $old)) && file_exists($file) && $old >= $oldRev) { // add old revision to the attic if missing saveOldRevision($id); // add a changelog entry if this edit came from outside dokuwiki @@ -1285,7 +1285,7 @@ function saveWikiText($id, $text, $summary, $minor = false) { */ function saveOldRevision($id) { $oldf = wikiFN($id); - if(!@file_exists($oldf)) return ''; + if(!file_exists($oldf)) return ''; $date = filemtime($oldf); $newf = wikiFN($id, $date); io_writeWikiPage($newf, rawWiki($id), $id, $date); @@ -1743,7 +1743,7 @@ function license_img($type) { $try[] = 'lib/images/license/'.$type.'/cc.png'; } foreach($try as $src) { - if(@file_exists(DOKU_INC.$src)) return $src; + if(file_exists(DOKU_INC.$src)) return $src; } return ''; } diff --git a/inc/confutils.php b/inc/confutils.php index 85bf5128c..8643a056c 100644 --- a/inc/confutils.php +++ b/inc/confutils.php @@ -206,7 +206,7 @@ function retrieveConfig($type,$fn,$params=null) { foreach (array('default','local','protected') as $config_group) { if (empty($config_cascade[$type][$config_group])) continue; foreach ($config_cascade[$type][$config_group] as $file) { - if (@file_exists($file)) { + if (file_exists($file)) { $config = call_user_func_array($fn,array_merge(array($file),$params)); $combined = array_merge($combined, $config); } diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php index 3c5bdfeee..c99fbf20a 100644 --- a/inc/fetch.functions.php +++ b/inc/fetch.functions.php @@ -163,7 +163,7 @@ function checkFileStatus(&$media, &$file, $rev = '', $width=0, $height=0) { } //check file existance - if(!@file_exists($file)) { + if(!file_exists($file)) { return array(404, 'Not Found'); } diff --git a/inc/html.php b/inc/html.php index 87affd47b..3a93a6604 100644 --- a/inc/html.php +++ b/inc/html.php @@ -501,7 +501,7 @@ function html_revisions($first=0, $media_id = false){ $form->addElement(form_makeOpenTag('ul')); if (!$media_id) $exists = $INFO['exists']; - else $exists = @file_exists(mediaFN($id)); + else $exists = file_exists(mediaFN($id)); $display_name = (!$media_id && useHeading('navigation')) ? hsc(p_get_first_heading($id)) : $id; if (!$display_name) $display_name = $id; @@ -568,7 +568,7 @@ function html_revisions($first=0, $media_id = false){ $date = dformat($rev); $info = $changelog->getRevisionInfo($rev); if($media_id) { - $exists = @file_exists(mediaFN($id, $rev)); + $exists = file_exists(mediaFN($id, $rev)); } else { $exists = page_exists($id, $rev); } @@ -765,7 +765,7 @@ function html_recent($first=0, $show_changes='both'){ $href = ''; if (!empty($recent['media'])) { - $diff = (count(getRevisions($recent['id'], 0, 1, 8192, true)) && @file_exists(mediaFN($recent['id']))); + $diff = (count(getRevisions($recent['id'], 0, 1, 8192, true)) && file_exists(mediaFN($recent['id']))); if ($diff) { $href = media_managerURL(array('tab_details' => 'history', 'mediado' => 'diff', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&'); diff --git a/inc/indexer.php b/inc/indexer.php index 014c5c5eb..a86bfc656 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -1076,7 +1076,7 @@ class Doku_Indexer { protected function getIndex($idx, $suffix) { global $conf; $fn = $conf['indexdir'].'/'.$idx.$suffix.'.idx'; - if (!@file_exists($fn)) return array(); + if (!file_exists($fn)) return array(); return file($fn, FILE_IGNORE_NEW_LINES); } @@ -1118,7 +1118,7 @@ class Doku_Indexer { protected function getIndexKey($idx, $suffix, $id) { global $conf; $fn = $conf['indexdir'].'/'.$idx.$suffix.'.idx'; - if (!@file_exists($fn)) return ''; + if (!file_exists($fn)) return ''; $fh = @fopen($fn, 'r'); if (!$fh) return ''; $ln = -1; @@ -1228,7 +1228,7 @@ class Doku_Indexer { // testing if index files exist only $path = $conf['indexdir']."/i"; foreach ($filter as $key => $value) { - if (@file_exists($path.$key.'.idx')) + if (file_exists($path.$key.'.idx')) $idx[] = $key; } } else { @@ -1339,7 +1339,7 @@ function & idx_get_stopwords() { if (is_null($stopwords)) { global $conf; $swfile = DOKU_INC.'inc/lang/'.$conf['lang'].'/stopwords.txt'; - if(@file_exists($swfile)){ + if(file_exists($swfile)){ $stopwords = file($swfile, FILE_IGNORE_NEW_LINES); }else{ $stopwords = array(); @@ -1364,7 +1364,7 @@ function idx_addPage($page, $verbose=false, $force=false) { $idxtag = metaFN($page,'.indexed'); // check if page was deleted but is still in the index if (!page_exists($page)) { - if (!@file_exists($idxtag)) { + if (!file_exists($idxtag)) { if ($verbose) print("Indexer: $page does not exist, ignoring".DOKU_LF); return false; } @@ -1379,7 +1379,7 @@ function idx_addPage($page, $verbose=false, $force=false) { } // check if indexing needed - if(!$force && @file_exists($idxtag)){ + if(!$force && file_exists($idxtag)){ if(trim(io_readFile($idxtag)) == idx_get_version()){ $last = @filemtime($idxtag); if($last > @filemtime(wikiFN($page))){ @@ -1392,7 +1392,7 @@ function idx_addPage($page, $verbose=false, $force=false) { $indexenabled = p_get_metadata($page, 'internal index', METADATA_RENDER_UNLIMITED); if ($indexenabled === false) { $result = false; - if (@file_exists($idxtag)) { + if (file_exists($idxtag)) { $Indexer = idx_get_indexer(); $result = $Indexer->deletePage($page); if ($result === "locked") { @@ -1494,7 +1494,7 @@ function idx_tokenizer($string, $wc=false) { function idx_getIndex($idx, $suffix) { global $conf; $fn = $conf['indexdir'].'/'.$idx.$suffix.'.idx'; - if (!@file_exists($fn)) return array(); + if (!file_exists($fn)) return array(); return file($fn); } @@ -1515,7 +1515,7 @@ function idx_listIndexLengths() { $docache = false; } else { clearstatcache(); - if (@file_exists($conf['indexdir'].'/lengths.idx') + if (file_exists($conf['indexdir'].'/lengths.idx') && (time() < @filemtime($conf['indexdir'].'/lengths.idx') + $conf['readdircache'])) { if (($lengths = @file($conf['indexdir'].'/lengths.idx', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)) !== false) { $idx = array(); @@ -1572,7 +1572,7 @@ function idx_indexLengths($filter) { // testing if index files exist only $path = $conf['indexdir']."/i"; foreach ($filter as $key => $value) { - if (@file_exists($path.$key.'.idx')) + if (file_exists($path.$key.'.idx')) $idx[] = $key; } } else { diff --git a/inc/infoutils.php b/inc/infoutils.php index 399963176..fe312d13f 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -58,7 +58,7 @@ function checkUpdateMessages(){ function getVersionData(){ $version = array(); //import version string - if(@file_exists(DOKU_INC.'VERSION')){ + if(file_exists(DOKU_INC.'VERSION')){ //official release $version['date'] = trim(io_readfile(DOKU_INC.'VERSION')); $version['type'] = 'Release'; @@ -141,20 +141,20 @@ function check(){ if(is_writable($conf['changelog'])){ msg('Changelog is writable',1); }else{ - if (@file_exists($conf['changelog'])) { + if (file_exists($conf['changelog'])) { msg('Changelog is not writable',-1); } } - if (isset($conf['changelog_old']) && @file_exists($conf['changelog_old'])) { + if (isset($conf['changelog_old']) && file_exists($conf['changelog_old'])) { msg('Old changelog exists', 0); } - if (@file_exists($conf['changelog'].'_failed')) { + if (file_exists($conf['changelog'].'_failed')) { msg('Importing old changelog failed', -1); - } else if (@file_exists($conf['changelog'].'_importing')) { + } else if (file_exists($conf['changelog'].'_importing')) { msg('Importing old changelog now.', 0); - } else if (@file_exists($conf['changelog'].'_import_ok')) { + } else if (file_exists($conf['changelog'].'_import_ok')) { msg('Old changelog imported', 1); if (!plugin_isdisabled('importoldchangelog')) { msg('Importoldchangelog plugin not disabled after import', -1); diff --git a/inc/init.php b/inc/init.php index 12bb6f588..91bc77f98 100644 --- a/inc/init.php +++ b/inc/init.php @@ -16,7 +16,7 @@ $config_cascade = array(); // if available load a preload config file $preload = fullpath(dirname(__FILE__)).'/preload.php'; -if (@file_exists($preload)) include($preload); +if (file_exists($preload)) include($preload); // define the include path if(!defined('DOKU_INC')) define('DOKU_INC',fullpath(dirname(__FILE__).'/../').'/'); @@ -28,7 +28,7 @@ if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); if(!defined('DOKU_CONF')) define('DOKU_CONF',DOKU_INC.'conf/'); // check for error reporting override or set error reporting to sane values -if (!defined('DOKU_E_LEVEL') && @file_exists(DOKU_CONF.'report_e_all')) { +if (!defined('DOKU_E_LEVEL') && file_exists(DOKU_CONF.'report_e_all')) { define('DOKU_E_LEVEL', E_ALL); } if (!defined('DOKU_E_LEVEL')) { @@ -65,7 +65,7 @@ $conf = array(); foreach (array('default','local','protected') as $config_group) { if (empty($config_cascade['main'][$config_group])) continue; foreach ($config_cascade['main'][$config_group] as $config_file) { - if (@file_exists($config_file)) { + if (file_exists($config_file)) { include($config_file); } } @@ -79,7 +79,7 @@ $license = array(); foreach (array('default','local') as $config_group) { if (empty($config_cascade['license'][$config_group])) continue; foreach ($config_cascade['license'][$config_group] as $config_file) { - if(@file_exists($config_file)){ + if(file_exists($config_file)){ include($config_file); } } @@ -272,7 +272,7 @@ function init_lang($langCode) { //load the language files require(DOKU_INC.'inc/lang/en/lang.php'); foreach ($config_cascade['lang']['core'] as $config_file) { - if (@file_exists($config_file . 'en/lang.php')) { + if (file_exists($config_file . 'en/lang.php')) { include($config_file . 'en/lang.php'); } } @@ -282,7 +282,7 @@ function init_lang($langCode) { require(DOKU_INC."inc/lang/$langCode/lang.php"); } foreach ($config_cascade['lang']['core'] as $config_file) { - if (@file_exists($config_file . "$langCode/lang.php")) { + if (file_exists($config_file . "$langCode/lang.php")) { include($config_file . "$langCode/lang.php"); } } @@ -298,7 +298,7 @@ function init_files(){ $files = array($conf['indexdir'].'/page.idx'); foreach($files as $file){ - if(!@file_exists($file)){ + if(!file_exists($file)){ $fh = @fopen($file,'a'); if($fh){ fclose($fh); @@ -312,7 +312,7 @@ function init_files(){ # create title index (needs to have same length as page.idx) /* $file = $conf['indexdir'].'/title.idx'; - if(!@file_exists($file)){ + if(!file_exists($file)){ $pages = file($conf['indexdir'].'/page.idx'); $pages = count($pages); $fh = @fopen($file,'a'); @@ -339,9 +339,9 @@ function init_files(){ function init_path($path){ // check existence $p = fullpath($path); - if(!@file_exists($p)){ + if(!file_exists($p)){ $p = fullpath(DOKU_INC.$path); - if(!@file_exists($p)){ + if(!file_exists($p)){ return ''; } } @@ -352,7 +352,7 @@ function init_path($path){ } // check accessability (execute bit) for directories - if(@is_dir($p) && !@file_exists("$p/.")){ + if(@is_dir($p) && !file_exists("$p/.")){ return ''; } @@ -593,7 +593,7 @@ function fullpath($path,$exists=false){ $finalpath = $root.implode('/', $newpath); // check for existence when needed (except when unit testing) - if($exists && !defined('DOKU_UNITTEST') && !@file_exists($finalpath)) { + if($exists && !defined('DOKU_UNITTEST') && !file_exists($finalpath)) { return false; } return $finalpath; diff --git a/inc/io.php b/inc/io.php index bfa394a17..3ed227162 100644 --- a/inc/io.php +++ b/inc/io.php @@ -105,7 +105,7 @@ function _io_readWikiPage_action($data) { */ function io_readFile($file,$clean=true){ $ret = ''; - if(@file_exists($file)){ + if(file_exists($file)){ if(substr($file,-3) == '.gz'){ $ret = join('',gzfile($file)); }else if(substr($file,-4) == '.bz2'){ @@ -204,7 +204,7 @@ function io_saveFile($file,$content,$append=false){ global $conf; $mode = ($append) ? 'ab' : 'wb'; - $fileexists = @file_exists($file); + $fileexists = file_exists($file); io_makeFileDir($file); io_lock($file); if(substr($file,-3) == '.gz'){ @@ -258,7 +258,7 @@ function io_saveFile($file,$content,$append=false){ * @return bool true on success */ function io_deleteFromFile($file,$badline,$regex=false){ - if (!@file_exists($file)) return true; + if (!file_exists($file)) return true; io_lock($file); @@ -385,7 +385,7 @@ function io_createNamespace($id, $ns_type='pages') { $ns_stack = explode(':', $id); $ns = $id; $tmp = dirname( $file = call_user_func($types[$ns_type], $ns) ); - while (!@is_dir($tmp) && !(@file_exists($tmp) && !is_dir($tmp))) { + while (!@is_dir($tmp) && !(file_exists($tmp) && !is_dir($tmp))) { array_pop($ns_stack); $ns = implode(':', $ns_stack); if (strlen($ns)==0) { break; } @@ -429,7 +429,7 @@ function io_makeFileDir($file){ function io_mkdir_p($target){ global $conf; if (@is_dir($target)||empty($target)) return 1; // best case check first - if (@file_exists($target) && !is_dir($target)) return 0; + if (file_exists($target) && !is_dir($target)) return 0; //recursion if (io_mkdir_p(substr($target,0,strrpos($target,'/')))){ if($conf['safemodehack']){ @@ -606,7 +606,7 @@ function io_download($url,$file,$useAttachment=false,$defaultName='',$maxSize=20 $file = $file.$name; } - $fileexists = @file_exists($file); + $fileexists = file_exists($file); $fp = @fopen($file,"w"); if(!$fp) return false; fwrite($fp,$data); diff --git a/inc/load.php b/inc/load.php index ac2812a0b..18786dc79 100644 --- a/inc/load.php +++ b/inc/load.php @@ -119,7 +119,7 @@ function load_autoload($name){ // try to load the wanted plugin file $c = ((count($m) === 4) ? "/{$m[3]}" : ''); $plg = DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php"; - if(@file_exists($plg)){ + if(file_exists($plg)){ include_once DOKU_PLUGIN . "{$m[2]}/{$m[1]}$c.php"; } return; diff --git a/inc/media.php b/inc/media.php index 09bfc99ac..81081d5dc 100644 --- a/inc/media.php +++ b/inc/media.php @@ -70,7 +70,7 @@ function media_metasave($id,$auth,$data){ } $old = @filemtime($src); - if(!@file_exists(mediaFN($id, $old)) && @file_exists($src)) { + if(!file_exists(mediaFN($id, $old)) && file_exists($src)) { // add old revision to the attic media_saveOldRevision($id); } @@ -141,7 +141,7 @@ function media_metaform($id,$auth){ if(is_null($fields)){ $config_files = getConfigFiles('mediameta'); foreach ($config_files as $config_file) { - if(@file_exists($config_file)) include($config_file); + if(file_exists($config_file)) include($config_file); } } @@ -241,14 +241,14 @@ function media_delete($id,$auth){ $data['id'] = $id; $data['name'] = utf8_basename($file); $data['path'] = $file; - $data['size'] = (@file_exists($file)) ? filesize($file) : 0; + $data['size'] = (file_exists($file)) ? filesize($file) : 0; $data['unl'] = false; $data['del'] = false; $evt = new Doku_Event('MEDIA_DELETE_FILE',$data); if ($evt->advise_before()) { $old = @filemtime($file); - if(!@file_exists(mediaFN($id, $old)) && @file_exists($file)) { + if(!file_exists(mediaFN($id, $old)) && file_exists($file)) { // add old revision to the attic media_saveOldRevision($id); } @@ -431,7 +431,7 @@ function media_save($file, $id, $ow, $auth, $move) { } //check for overwrite - $overwrite = @file_exists($fn); + $overwrite = file_exists($fn); $auth_ow = (($conf['mediarevisions']) ? AUTH_UPLOAD : AUTH_DELETE); if($overwrite && (!$ow || $auth < $auth_ow)) { return array($lang['uploadexist'], 0); @@ -497,7 +497,7 @@ function media_upload_finish($fn_tmp, $fn, $id, $imime, $overwrite, $move = 'mov global $REV; $old = @filemtime($fn); - if(!@file_exists(mediaFN($id, $old)) && @file_exists($fn)) { + if(!file_exists(mediaFN($id, $old)) && file_exists($fn)) { // add old revision to the attic if missing media_saveOldRevision($id); } @@ -541,7 +541,7 @@ function media_saveOldRevision($id){ global $conf, $lang; $oldf = mediaFN($id); - if(!@file_exists($oldf)) return ''; + if(!file_exists($oldf)) return ''; $date = filemtime($oldf); if (!$conf['mediarevisions']) return $date; @@ -549,7 +549,7 @@ function media_saveOldRevision($id){ if (!$medialog->getRevisionInfo($date)) { // there was an external edit, // there is no log entry for current version of file - if (!@file_exists(mediaMetaFN($id,'.changes'))) { + if (!file_exists(mediaMetaFN($id,'.changes'))) { addMediaLogEntry($date, $id, DOKU_CHANGE_TYPE_CREATE, $lang['created']); } else { addMediaLogEntry($date, $id, DOKU_CHANGE_TYPE_EDIT); @@ -721,7 +721,7 @@ function media_tabs_details($image, $selected_tab = ''){ 'caption' => $lang['media_viewtab']); list(, $mime) = mimetype($image); - if ($mime == 'image/jpeg' && @file_exists(mediaFN($image))) { + if ($mime == 'image/jpeg' && file_exists(mediaFN($image))) { $tabs['edit'] = array('href' => media_managerURL(array('tab_details' => 'edit'), '&'), 'caption' => $lang['media_edittab']); } @@ -1008,7 +1008,7 @@ function media_preview_buttons($image, $auth, $rev='') { echo '