Skip to content

Commit

Permalink
Simplify substr usages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean85 authored and Frederic Delaunay committed Oct 29, 2018
1 parent e66274a commit 5fc4d1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private function addContinue($data)
// 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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Writer/Xls/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ private function convertNumber($num)
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');
}
Expand Down

0 comments on commit 5fc4d1c

Please sign in to comment.