diff options
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/inc/common.php b/inc/common.php index 32771285b..9a53ee526 100644 --- a/inc/common.php +++ b/inc/common.php @@ -155,12 +155,13 @@ function pageinfo() { $info['subscribed'] = false; } - $info['locked'] = checklock($ID); - $info['filepath'] = fullpath(wikiFN($ID)); - $info['exists'] = @file_exists($info['filepath']); + $info['locked'] = checklock($ID); + $info['filepath'] = fullpath(wikiFN($ID)); + $info['exists'] = @file_exists($info['filepath']); + $info['currentrev'] = @filemtime($info['filepath']); if($REV) { //check if current revision was meant - if($info['exists'] && (@filemtime($info['filepath']) == $REV)) { + if($info['exists'] && ($info['currentrev'] == $REV)) { $REV = ''; } elseif($RANGE) { //section editing does not work with old revisions! @@ -1140,7 +1141,6 @@ function saveWikiText($id, $text, $summary, $minor = false) { * @author Andreas Gohr <andi@splitbrain.org> */ function saveOldRevision($id) { - global $conf; $oldf = wikiFN($id); if(!@file_exists($oldf)) return ''; $date = filemtime($oldf); @@ -1230,8 +1230,9 @@ function getGoogleQuery() { /** * Return the human readable size of a file * - * @param int $size A file size - * @param int $dec A number of decimal places + * @param int $size A file size + * @param int $dec A number of decimal places + * @return string human readable size * @author Martin Benjamin <b.martin@cybernet.ch> * @author Aidan Lister <aidan@php.net> * @version 1.0.0 @@ -1362,12 +1363,16 @@ function php_to_byte($v) { $l = substr($v, -1); $ret = substr($v, 0, -1); switch(strtoupper($l)) { + /** @noinspection PhpMissingBreakStatementInspection */ case 'P': $ret *= 1024; + /** @noinspection PhpMissingBreakStatementInspection */ case 'T': $ret *= 1024; + /** @noinspection PhpMissingBreakStatementInspection */ case 'G': $ret *= 1024; + /** @noinspection PhpMissingBreakStatementInspection */ case 'M': $ret *= 1024; case 'K': |