Skip to content

Commit 390d7ac

Browse files
committed
Fix : ValueError: fread(): Argument FriendsOfSymfony1#2 ($length) must be greater than 0
1 parent 99b00c7 commit 390d7ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/cache/sfFileCache.class.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,11 @@ protected function read($path, $type = self::READ_DATA)
256256
fseek($fp, 0, SEEK_END);
257257
$length = ftell($fp) - 24;
258258
fseek($fp, 24);
259-
if($length < 0) {
260-
$length = 0;
259+
if($length > 0) {
260+
$data[self::READ_DATA] = @fread($fp, $length);
261+
} else {
262+
$data[self::READ_DATA] = '';
261263
}
262-
$data[self::READ_DATA] = @fread($fp, $length);
263264
}
264265
}
265266
else

0 commit comments

Comments
 (0)