Bug #66843 [Fbk->Opn]: set_error_handler message is cut

From: Date: Tue, 25 Mar 2014 19:53:49 +0000
Subject: Bug #66843 [Fbk->Opn]: set_error_handler message is cut
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184888@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66843&edit=1

 ID:                 66843
 User updated by:    php at maisqi dot com
 Reported by:        php at maisqi dot com
 Summary:            set_error_handler message is cut
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            *General Issues
 Operating System:   Windows and Linux
 PHP Version:        5.5.10
 Block user comment: N
 Private report:     N

 New Comment:

I tested it now without htmlspecialchars() and the problem remains. Check the file for yourself; it
outputs the source code now.
Thanks.


Previous Comments:
------------------------------------------------------------------------
[2014-03-25 14:25:32] ab@php.net

But have you tried to remove the htmlspecialchars() call?

Thanks.

------------------------------------------------------------------------
[2014-03-11 16:22:36] php at maisqi dot com

@ab@php.net
Thanks for your help but I don't think that's the problem. I changed the script on the
server to output error log: http://maisqi.com/outros/bugs/php/66843
The message of the error log is being output fully, so it can't be an issue with the character
encoding, or both would be truncated.

------------------------------------------------------------------------
[2014-03-11 10:13:11] ab@php.net

Under Apache you should check if there's something in the error_log, sometimes that output will
go to stderr so it'll be seen in the error logs only. Whereby what you show is probably not the
case.

I assume the issue you've got is laying in the usage of htmlspecialchars. Please check your
error messages are in the right charset.

Thanks.

------------------------------------------------------------------------
[2014-03-07 12:41:49] php at maisqi dot com

Test script in http://maisqi.com/outros/bugs/php/66843, running
on a Linux server.

------------------------------------------------------------------------
[2014-03-07 12:39:38] php at maisqi dot com

Description:
------------
The message passed to the function registered with set_error_handler is sometimes cut. I tested the
error reporting with or without set_error_handler() and the message is incomplete on the latter.

Test script:
---------------
<pre>
<?php
ini_set ('display_errors', '1');

echo "<h2>With no set_error_handler()</h2>\n";
test ();

echo "<h2>With the set_error_handler() setup</h2>\n";
set_error_handler (function ($code, $message) {	echo '== ', htmlspecialchars
($message);	});
test ();

echo "\n\n\n\nDone";

function test ($a) {}

Expected result:
----------------
It should be output the exact same message two times.

Actual result:
--------------
The first message (with no set_error_handler() is ok; the second is trimmed after
"defined".


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66843&edit=1


Thread (10 messages)

« previous php.bugs (#184888) next »