diff --git a/inc/common.php b/inc/common.php index 8fe797187556684750a42c8c6a7b920cdf1da59d..8ad55efff871ad4e03a9873d200c587b77bb7378 100644 --- a/inc/common.php +++ b/inc/common.php @@ -733,7 +733,11 @@ function getRecents($first,$num,$ns='',$flags=0){ // now read backwards into buffer while($pos > 0){ $pos -= $csz; // seek to previous chunk... - if($pos < 0) $pos = 0; // ...or rest of file + if($pos < 0) { // ...or rest of file + $csz += $pos; + $pos = 0; + } + fseek($fh,$pos); $buf = fread($fh,$csz).$buf; // prepend to buffer