[xdebug-dev] Bug 0000206: Escape binary output

From: <noreply[@]lists.xdebug.org>
Date: Tue, 21 Nov 2006 20:01:20 +0100

The following bug has been RESOLVED.
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000206
======================================================================
Reporter: MarcusBointon
Handler: derick
======================================================================
Project: Xdebug
Bug ID: 206
Category: Feature/Change request
Reproducibility: always
Severity: tweak
Priority: normal
Status: resolved
Operating System: all
PHP Version: 5.1.6
Xdebug Version: 2.0.0rc1
Resolution: not fixable
======================================================================
Date Submitted: 2006-10-17 10:22 CEST
Last Modified: 2006-11-21 20:01 CET
======================================================================
Summary: Escape binary output
Description:
If I get a PHP error and xdebug displays local variables, and one of those
variables contains something binary like an image, I usually find that it
corrupts the terminal, turning all text in the terminal into gibberish,
presumably because the binary data contains terminal escape sequences. I
have to kill the terminal and reopen it to restore readability. Can the
output be somehow escaped to avoid this?
======================================================================

----------------------------------------------------------------------
 derick - 2006-10-18 16:12 CEST
----------------------------------------------------------------------
I just checked, and I am already escaping ascii 0 to ascii 31... and can
therefore not reproduce your problem. Could you provide a short test case
for me please? (Including all settings that you make?)

----------------------------------------------------------------------
 MarcusBointon - 2006-10-24 02:29 CEST
----------------------------------------------------------------------
OK, I had a try at reproducing it, and you're right in that I can't get it
to happen with the local vars display, however, it does happen with
var_dump, so I guess I must have been confused - sorry about that. This
example causes a nice exploding terminal for me:

<?php
class z {
public $zz;
}
$zx = new z;
$zx->zz = file_get_contents('image.png');
var_dump($zx);
?>

I don't know if this behaviour is intended or not, but I can't think of
any circumstances I'd want it.

----------------------------------------------------------------------
 derick - 2006-11-21 20:01 CET
----------------------------------------------------------------------
When html_errors is turned off Xdebug will use PHP's internal var_dump
function. This function exhibits this problem and your issue can be
reproduced even when Xdebug is not loaded. I agree that this should be
addressed, but it should be addressed in PHP itself.

Bug History
Date Modified Username Field Change
======================================================================
2006-10-17 10:22MarcusBointon New Bug
2006-10-17 10:22MarcusBointon Bug Monitored: MarcusBointon
2006-10-18 16:12derick Bugnote Added: 0000476
2006-10-18 16:12derick Status new => feedback
2006-10-24 02:29MarcusBointon Bugnote Added: 0000484
2006-11-21 20:01derick Bugnote Added: 0000492
2006-11-21 20:01derick Assigned To => derick
2006-11-21 20:01derick Resolution open => not fixable
2006-11-21 20:01derick Status feedback => resolved
======================================================================
Received on Tue Nov 21 2006 - 20:01:23 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST