|
|
|
@ -162,7 +162,9 @@ function iil_xor($string, $string2) {
|
|
|
|
|
|
|
|
|
|
function iil_ReadLine($fp, $size) {
|
|
|
|
|
$line = '';
|
|
|
|
|
if ($fp) {
|
|
|
|
|
if (!$fp) {
|
|
|
|
|
return $line;
|
|
|
|
|
}
|
|
|
|
|
do {
|
|
|
|
|
// FIXME: hardcode size?
|
|
|
|
|
$buffer = fgets($fp, 2048);
|
|
|
|
@ -171,7 +173,6 @@ function iil_ReadLine($fp, $size) {
|
|
|
|
|
}
|
|
|
|
|
$line .= $buffer;
|
|
|
|
|
} while ($buffer[strlen($buffer)-1] != "\n");
|
|
|
|
|
}
|
|
|
|
|
return $line;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -196,6 +197,9 @@ function iil_ReadBytes($fp, $bytes) {
|
|
|
|
|
$len = 0;
|
|
|
|
|
do {
|
|
|
|
|
$data .= fread($fp, $bytes-$len);
|
|
|
|
|
if ($len == strlen($data)) {
|
|
|
|
|
break; //nothing was read -> exit to avoid apache lockups
|
|
|
|
|
}
|
|
|
|
|
$len = strlen($data);
|
|
|
|
|
} while ($len < $bytes);
|
|
|
|
|
return $data;
|
|
|
|
|