Uncaught crash with html header or footer caused by wrong length estimation
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
i don't know the exact reason, but some times, html headers|footers (strings) sent in option don't pass the isFile test, crashing with a 500 error code. i suppose, depending of the encoding (utf8 in my case), the value length is miscalculated and this test fails in the AbstractGenerator (line 695) :
protected function isFile($filename)
{
return \strlen($filename) <= \PHP_MAXPATHLEN && \is_file($filename);
}
causing the is_file function to crash. I tried to replace strlen by mb_strlen without success but add an error control operator **@\is_file** does the trick :
protected function isFile($filename)
{
return \strlen($filename) <= \PHP_MAXPATHLEN && @\is_file($filename);
}
Contributor guide
Assessment
This issue has not been assessed yet.