php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77583 The message for class “Exception” causes PHP Fatal Error
Submitted: 2019-02-08 00:53 UTC Modified: 2019-02-08 04:48 UTC
From: p_i at ukr dot net Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: 7.2.15 OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: p_i at ukr dot net
New email:
PHP Version: OS:

 

 [2019-02-08 00:53 UTC] p_i at ukr dot net
Description:
------------
After execute this simple code:

$message = 'some text '.inet_pton('119.252.33.171');
throw new \Exception($message);
PHP returns Fatal Error

Fatal error</b>: in ...

This behavior is noticed when converting many other IPs. At the moment I solved the problem with the following line before "throw new":

$message = preg_replace( '/[^[:print:]\r\n]/', '_', $message);


Test script:
---------------
<?php
//http://sandbox.onlinephpfunctions.com/code/0010e95a4bec4f6a4521ad58af90db256db6224b

$message = 'some text '.inet_pton('119.252.33.171');
//$message = preg_replace( '/[^[:print:]\r\n]/', 'X', $message);
throw new \Exception($message);
    
//$message = 'some text ';
//throw new \Exception($message);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-08 04:48 UTC] requinix@php.net
-Status: Open +Status: Duplicate -Package: Compile Failure +Package: Scripting Engine problem
 [2019-02-08 04:48 UTC] requinix@php.net
Duplicate of bug #70894
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jul 10 10:01:26 2020 UTC