jasonrogena / jasonrogena/php-excel-reader

String being truncated while reading a big file

Open
#142 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated Priority-Medium Type-Defect
Dominant language
PHP
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
Hello

I'm sorry, I can't attach a file that causes a bug because of some company
policies forbid it.
I found that the bug might be near the the line 1108.

$newstr = '';
for ($j = 0; $j < strlen($retstr); $j++) {
$newstr = $retstr[$j].chr(0);
}
$retstr = $newstr;

I really not an expert in excel's inner file format, but I think that this code
will truncate the string inside the $retstr variable.
I replaced the
$newstr = $retstr[$j].chr(0);
with
$newstr .= $retstr[$j].chr(0);

and now everything works as it should be (at least it looks like that).

Thank you.

Dmitry.
```

Original issue reported on code.google.com by `dklimenk...@gmail.com` on 21 Feb 2012 at 3:27

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at line 1108 and inspect how the $retstr loop builds the string while reading a large file. Reproduce the report with a large input and confirm that the resulting string is preserved in full rather than truncated.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.