php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74725 html_errors=1 breaks unhandled exceptions
Submitted: 2017-06-09 08:48 UTC Modified: 2017-08-12 00:43 UTC
From: anrdaemon at freemail dot ru Assigned: ajf
Status: Closed Package: Scripting Engine problem
PHP Version: 7.1.6 OS: All
Private report: No CVE-ID:
 [2017-06-09 08:48 UTC] anrdaemon at freemail dot ru
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-12 00:40 UTC] ajf@php.net
Automatic comment on behalf of ajf@ajf.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b59718bdc439f82fa1beae2c4ea1582c38bc8de3
Log: Fix bug #74725 (html_errors=1 breaks unhandled exceptions)
 [2017-08-12 00:40 UTC] ajf@php.net
-Status: Open +Status: Closed
 [2017-08-12 00:40 UTC] ajf@php.net
Automatic comment on behalf of ajf@ajf.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b59718bdc439f82fa1beae2c4ea1582c38bc8de3
Log: Fix bug #74725 (html_errors=1 breaks unhandled exceptions)
 [2017-08-12 00:40 UTC] ajf@php.net
Automatic comment on behalf of ajf@ajf.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b59718bdc439f82fa1beae2c4ea1582c38bc8de3
Log: Fix bug #74725 (html_errors=1 breaks unhandled exceptions)
 [2017-08-12 00:40 UTC] ajf@php.net
Automatic comment on behalf of ajf@ajf.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b59718bdc439f82fa1beae2c4ea1582c38bc8de3
Log: Fix bug #74725 (html_errors=1 breaks unhandled exceptions)
 [2017-08-12 00:43 UTC] ajf@php.net
-Assigned To: +Assigned To: ajf
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC