diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-01-28 01:17:40 +0100 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-01-28 01:17:40 +0100 |
commit | ce2f604739dc66e32e05f7078ada1711fe387979 (patch) | |
tree | a6672fccb52cb8f64cd715c173c3118ce50d7dcf | |
parent | f9528c0c7accd2da60f16864555b4982b940a1a0 (diff) | |
download | rpg-ce2f604739dc66e32e05f7078ada1711fe387979.tar.gz rpg-ce2f604739dc66e32e05f7078ada1711fe387979.tar.bz2 |
Add working EoF and BoF checks when chunck reading.
Also isset on meta-last_change-date entry.
-rw-r--r-- | inc/changelog.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/changelog.php b/inc/changelog.php index e25c3144e..d2be5b2db 100644 --- a/inc/changelog.php +++ b/inc/changelog.php @@ -574,7 +574,7 @@ function getRelativeRevision($id, $rev, $direction, $chunk_size = 8192, $media = $rev = max($rev, 0); //no direction given or last rev, so no follow-up - if(!$direction || ($direction > 0 && $rev == $INFO['meta']['last_change']['date'])) { + if(!$direction || ($direction > 0 && isset($INFO['meta']['last_change']['date']) && $rev == $INFO['meta']['last_change']['date'])) { return false; } @@ -682,7 +682,7 @@ function getRelativeRevision($id, $rev, $direction, $chunk_size = 8192, $media = //true when $rev is found, but not the wanted follow-up. $checkotherchunck = $uses_chuncks && ($tmp['date'] == $rev || ($revcounter > 0 && !$relrev)) - && !feof($fp); + && !(($tail == $eof && $direction > 0) || ($head == 0 && $direction < 0)); if($checkotherchunck) { if($direction > 0) { @@ -712,7 +712,7 @@ function getRelativeRevision($id, $rev, $direction, $chunk_size = 8192, $media = fclose($fp); } - if($relrev == $INFO['meta']['last_change']['date']) { + if(isset($INFO['meta']['last_change']) && $relrev == $INFO['meta']['last_change']['date']) { return 'current'; } return $relrev; |