Skip to content

Commit 453f8f1

Browse files
Jean85PowerKiKi
authored andcommitted
Simplify substr usages
1 parent 30ec11c commit 453f8f1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private function addContinue($data)
217217
// Retrieve the last chunk of data
218218
$header = pack('vv', $record, strlen($data) - $i);
219219
$tmp .= $header;
220-
$tmp .= substr($data, $i, strlen($data) - $i);
220+
$tmp .= substr($data, $i);
221221

222222
return $tmp;
223223
}

src/PhpSpreadsheet/Writer/Xls/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ private function convertNumber($num)
561561
private function convertString($string)
562562
{
563563
// chop away beggining and ending quotes
564-
$string = substr($string, 1, strlen($string) - 2);
564+
$string = substr($string, 1, -2);
565565
if (strlen($string) > 255) {
566566
throw new WriterException('String is too long');
567567
}

0 commit comments

Comments
 (0)