diff --git a/inc/common.php b/inc/common.php index 65ea4c897a32504f940e21c5ac21724836ba6069..ca60b8edcfd89cd754e137cf203c151d59bb6aae 100644 --- a/inc/common.php +++ b/inc/common.php @@ -538,7 +538,7 @@ function checklock($id){ //lockfile expired if((time() - filemtime($lock)) > $conf['locktime']){ - unlink($lock); + @unlink($lock); return false; } @@ -898,7 +898,7 @@ function getRevisionInfo($id, $rev, $chunk_size=8192) { } $file = metaFN($id, '.changes'); - if (!file_exists($file)) { return false; } + if (!@file_exists($file)) { return false; } if (filesize($file)<$chunk_size || $chunk_size==0) { // read whole file $lines = file($file); @@ -995,12 +995,12 @@ function getRevisions($id, $first, $num, $chunk_size=8192) { $num = max($num, 0); $chunk_size = max($chunk_size, 0); if ($first<0) { $first = 0; } - else if (file_exists(wikiFN($id))) { + else if (@file_exists(wikiFN($id))) { // skip current revision if the page exists $first = max($first+1, 0); } - if (!file_exists($file)) { return $revs; } + if (!@file_exists($file)) { return $revs; } if (filesize($file)<$chunk_size || $chunk_size==0) { // read whole file $lines = file($file); @@ -1085,7 +1085,7 @@ function saveWikiText($id,$text,$summary,$minor=false){ $file = wikiFN($id); $old = saveOldRevision($id); $wasRemoved = empty($text); - $wasCreated = !file_exists($file); + $wasCreated = !@file_exists($file); $wasReverted = ($REV==true); if ($wasRemoved){ @@ -1096,7 +1096,7 @@ function saveWikiText($id,$text,$summary,$minor=false){ $changelog = metaFN($id, '.changes'); foreach ($mfiles as $mfile) { // but keep per-page changelog to preserve page history - if (file_exists($mfile) && $mfile!==$changelog) { @unlink($mfile); } + if (@file_exists($mfile) && $mfile!==$changelog) { @unlink($mfile); } } $del = true; // autoset summary on deletion @@ -1351,20 +1351,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); } @@ -1467,7 +1467,7 @@ function subscriber_addresslist($id){ $mlist = array(); $file=metaFN($id,'.mlist'); - if (file_exists($file)) { + if (@file_exists($file)) { $mlist = file($file); } if(count($mlist) > 0) { diff --git a/inc/init.php b/inc/init.php index 69dd4766b6822fdfe0819b8d7a82735836c3b1f7..2ba16c2c3ba750d90e2405fe9106f877f0349702 100644 --- a/inc/init.php +++ b/inc/init.php @@ -17,7 +17,7 @@ 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')) { error_reporting(E_ALL ^ E_NOTICE); } diff --git a/inc/io.php b/inc/io.php index f9fbbd103b5fd2d5c2c51e1b478a4e19c44eb7a5..2b1272675775585e2698caf4925e2b24821e244e 100644 --- a/inc/io.php +++ b/inc/io.php @@ -170,7 +170,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'){ @@ -470,7 +470,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/pageutils.php b/inc/pageutils.php index 5fadd7a36c9a1e624b33567cf3019ab9e1c51bf2..69e04f4895f1e2b173b3677a8d49cf883f031c2e 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -169,9 +169,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 diff --git a/inc/pluginutils.php b/inc/pluginutils.php index a93cca93605e07bf7dacf77010a9ab61e4a96e98..0adba09f34f7435a77a1e3311f383f743fcaeef8 100644 --- a/inc/pluginutils.php +++ b/inc/pluginutils.php @@ -73,7 +73,7 @@ function &plugin_load($type,$name){ } //try to load the wanted plugin file - if (file_exists(DOKU_PLUGIN."$name/$type.php")){ + if (@file_exists(DOKU_PLUGIN."$name/$type.php")){ include_once(DOKU_PLUGIN."$name/$type.php"); }else{ list($plugin, $component) = preg_split("/_/",$name, 2); diff --git a/inc/template.php b/inc/template.php index 81913a8e7f2de1817a89ecc5ca9380164c27234f..7392b541336136d851f433bf488a5c0d7f4bf858 100644 --- a/inc/template.php +++ b/inc/template.php @@ -635,7 +635,7 @@ function tpl_youarehere($sep=' » '){ $page = $part.$parts[$i]; if($page == $conf['start']) return; echo $sep; - if(file_exists(wikiFN($page))){ + if(@file_exists(wikiFN($page))){ $title = p_get_first_heading($page); if(!$title) $title = $parts[$i]; tpl_link(wl($page),$title,'title="'.$page.'"'); diff --git a/lib/exe/detail.php b/lib/exe/detail.php index 3a7e6159785b3189e95bd3805dffb0a2a8a61f12..a9fe72b9174dd5eebc8b0c68913c6a24a6c7180e 100644 --- a/lib/exe/detail.php +++ b/lib/exe/detail.php @@ -35,7 +35,7 @@ if($AUTH >= AUTH_READ){ // check if image exists $SRC = mediaFN($IMG); - if(!file_exists($SRC)){ + if(!@file_exists($SRC)){ //doesn't exist! } diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index d6570791190bc5a4ce284927e8ae4d3134ee5553..ad2ad801015008ef1f946370e67d6cb3368badb6 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -47,8 +47,8 @@ function runTrimRecentChanges() { // Uses the imporoldchangelog plugin to upgrade the changelog automaticaly. // FIXME: Remove this from runTrimRecentChanges when it is no longer needed. if (isset($conf['changelog_old']) && - file_exists($conf['changelog_old']) && !file_exists($conf['changelog']) && - !file_exists($conf['changelog'].'_importing') && !file_exists($conf['changelog'].'_tmp')) { + @file_exists($conf['changelog_old']) && !@file_exists($conf['changelog']) && + !@file_exists($conf['changelog'].'_importing') && !@file_exists($conf['changelog'].'_tmp')) { $tmp = array(); // no event data trigger_event('TEMPORARY_CHANGELOG_UPGRADE_EVENT', $tmp); return true; @@ -58,9 +58,9 @@ function runTrimRecentChanges() { // Trims the recent changes cache to the last $conf['changes_days'] recent // changes or $conf['recent'] items, which ever is larger. // The trimming is only done once a day. - if (file_exists($conf['changelog']) && + if (@file_exists($conf['changelog']) && (filectime($conf['changelog'])+86400)<time() && - !file_exists($conf['changelog'].'_tmp')) { + !@file_exists($conf['changelog'].'_tmp')) { io_lock($conf['changelog']); $lines = file($conf['changelog']); if (count($lines)<$conf['recent']) { @@ -86,12 +86,12 @@ function runTrimRecentChanges() { } } io_saveFile($conf['changelog'].'_tmp', implode('', $out_lines)); - unlink($conf['changelog']); + @unlink($conf['changelog']); if (!rename($conf['changelog'].'_tmp', $conf['changelog'])) { // rename failed so try another way... io_unlock($conf['changelog']); io_saveFile($conf['changelog'], implode('', $out_lines)); - unlink($conf['changelog'].'_tmp'); + @unlink($conf['changelog'].'_tmp'); } else { io_unlock($conf['changelog']); } diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index 57d27e7ebe685d0100fa592a48d2944fed46a245..4981c795c6cf80653fb8b4467ffe26e4a70c9596 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -190,7 +190,7 @@ if (!class_exists('configuration')) { $local = eval('return '.$this->_local_file.';'); if (!is_writable(dirname($local))) return true; - if (file_exists($local) && !is_writable($local)) return true; + if (@file_exists($local) && !is_writable($local)) return true; return false; } diff --git a/lib/plugins/importoldchangelog/action.php b/lib/plugins/importoldchangelog/action.php index 400ff6a183986962c5645a650b1434fdcc1babe4..e927b3e26502d7243b981dcb7b9f03302365f7c6 100644 --- a/lib/plugins/importoldchangelog/action.php +++ b/lib/plugins/importoldchangelog/action.php @@ -117,7 +117,7 @@ class action_plugin_importoldchangelog extends DokuWiki_Action_Plugin { function resetTimer() { // Add 5 minutes to the script execution timer... // This should be much more than needed. - set_time_limit(5*60); + @set_time_limit(5*60); // Note: Has no effect in safe-mode! } @@ -150,7 +150,7 @@ class action_plugin_importoldchangelog extends DokuWiki_Action_Plugin { ksort($recent); // ensure correct order of recent changes io_unlock($conf['changelog']); // hand off the lock to io_saveFile io_saveFile($conf['changelog'], implode('', $recent)); - unlink($conf['changelog'].'_importing'); // changelog importing unlock + @unlink($conf['changelog'].'_importing'); // changelog importing unlock } } @@ -163,7 +163,7 @@ function importoldchangelog_plugin_shutdown() { $path['failed'] = $conf['changelog'].'_failed'; $path['import_ok'] = $conf['changelog'].'_import_ok'; io_unlock($path['changelog']); // guarantee unlocking - if (file_exists($path['importing'])) { + if (@file_exists($path['importing'])) { // import did not finish rename($path['importing'], $path['failed']) or trigger_error('Importing changelog failed.', E_USER_WARNING); @unlink($path['import_ok']); diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php index 03efae3bf402be9725d68b766255583f8233dd3b..643754771a897190c077a6da8399538221707bd9 100644 --- a/lib/plugins/plugin/admin.php +++ b/lib/plugins/plugin/admin.php @@ -723,7 +723,7 @@ class ap_manage { $path = DOKU_PLUGIN.$plugin.'/'; foreach ($plugin_types as $type) { - if (file_exists($path.$type.'.php')) { $components[] = array('name'=>$plugin, 'type'=>$type); continue; } + if (@file_exists($path.$type.'.php')) { $components[] = array('name'=>$plugin, 'type'=>$type); continue; } if ($dh = @opendir($path.$type.'/')) { while (false !== ($cp = readdir($dh))) {