Bug #74725 [NEW]: html_errors=1 breaks unhandled exceptions
| From: | anrdaemon at freemail dot ru | Date: | Fri, 09 Jun 2017 08:48:49 +0000 |
| Subject: | Bug #74725 [NEW]: html_errors=1 breaks unhandled exceptions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209441@lists.php.net to get a copy of this message | ||
From: anrdaemon at freemail dot ru
Operating system: All
PHP version: 7.1.6
Package: Scripting Engine problem
Bug Type: Bug
Bug description:html_errors=1 breaks unhandled exceptions
Description:
------------
When a non-UTF-8 message is passed to the thrown exception, and
exception is unhandled, the resulting output of the internal exception
handler is missing exception's information (message/backtrace).
Regression since PHP 5.4
Reproducible with at least CLI, FCGI and FPM SAPI's, on Debian and
Windows.
Ref: https://3v4l.org/Ah2XP
Test script:
---------------
<?php
ini_set('display_errors', 1);
ini_set('html_errors', 1);
ini_set('default_charset', "Windows-1251");
throw new Exception("\xF2\xE5\xF1\xF2"); // "ÑеÑÑ"
Expected result:
----------------
<br />
<b>Fatal error</b>: Uncaught exception 'Exception' with message
'ÑеÑÑ' in /path/file:5
Stack trace:
#0 {main}
thrown in <b>/path/file</b> on line <b>5</b><br />
Process exited with code 255.
Actual result:
--------------
<br />
<b>Fatal error</b>: in <b>/path/file</b> on line
<b>5</b><br />
Process exited with code 255.
--
Edit bug report at https://bugs.php.net/bug.php?id=74725&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74725&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74725&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74725&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74725&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74725&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74725&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74725&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74725&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74725&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74725&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74725&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74725&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74725&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74725&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74725&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74725&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74725&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74725&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74725&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74725&r=mysqlcfg