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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 03:01:29 2024 UTC