Simplify substr usages

This commit is contained in:
Alessandro Lai 2017-12-22 11:00:58 +01:00 committed by Adrien Crivelli
parent 30ec11c7fa
commit 453f8f1821
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
2 changed files with 2 additions and 2 deletions

View File

@ -217,7 +217,7 @@ class BIFFwriter
// Retrieve the last chunk of data
$header = pack('vv', $record, strlen($data) - $i);
$tmp .= $header;
$tmp .= substr($data, $i, strlen($data) - $i);
$tmp .= substr($data, $i);
return $tmp;
}

View File

@ -561,7 +561,7 @@ class Parser
private function convertString($string)
{
// chop away beggining and ending quotes
$string = substr($string, 1, strlen($string) - 2);
$string = substr($string, 1, -2);
if (strlen($string) > 255) {
throw new WriterException('String is too long');
}