MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000184XdebugFeature/Change requestpublic2006-05-19 07:392006-08-19 14:26
Reporterjudas_iscariote 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusclosedResolutionreopened 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000184: problem with control chars in code traces
DescriptionIm not very sure if this is a bug, a limitation or just how the editors behave :-)
but in code like

str_replace(array("\r", "\n"), ' ', 'foobar');

control chars gets parsed by every single editor I tried
and traces do not display the real values passed.(just a new line or carriage return in the file is created)

not sure if you can determine with something internal like ctype_cntrl() if the param is only a control char, and escape it to get the real literal param displayed in trace.

Thus, I opened this as feature request.

  

TagsNo tags attached.
Operating System
PHP Version5.1-dev
Attached Files

- Relationships

-  Notes
(0000412)
derick (administrator)
2006-05-27 22:07

Fixed in CVS.
(0000416)
judas_iscariote (reporter)
2006-05-28 04:19

Hi, it works fine now, however.

If I pass a NULL byte.

str_replace("\0", ' ', 'foobar');

( "\0" or chr(0) same result)

0.0002 100704 -> str_replace('\000', ' ', 'foobar') is printed in the trace file, correct me if Im wrong, but I Expect to see str_replace('\0', ' ', 'foobar') or Im missing something ?
(0000418)
judas_iscariote (reporter)
2006-06-02 07:58

update test case

Index: tests/bug00184.phpt
===================================================================
RCS file: /repository/xdebug/tests/bug00184.phpt,v
retrieving revision 1.1
diff -u -a -r1.1 bug00184.phpt
--- tests/bug00184.phpt 27 May 2006 20:06:57 -0000 1.1
+++ tests/bug00184.phpt 2 Jun 2006 05:56:32 -0000
@@ -15,7 +15,7 @@
 --FILE--
 <?php
        $trace_file = xdebug_get_tracefile_name();
- str_replace(array("\r", "\n"), ' ', 'foobar');
+ str_replace(array("\r", "\n","\0"), ' ', 'foobar');
        echo file_get_contents($trace_file);
        unlink($trace_file);
        echo "DONE\n";
@@ -25,7 +25,7 @@
 %w%f %w%d -> {main}() %sbug00184.php:0
 %w%f %w%d -> xdebug_get_tracefile_name() %sbug00184.php:2
                            >=> '/tmp/trace.%d.xt'
-%w%f %w%d -> str_replace(array (0 => '\r', 1 => '\n'), ' ', 'foobar') %sbug00184.php:3
+%w%f %w%d -> str_replace(array (0 => '\r', 1 => '\n', 2=>'\0'), ' ', 'foobar') %sbug00184.php:3
                            >=> 'foobar'
 %w%f %w%d -> file_get_contents('/tmp/trace.%d.xt') %sbug00184.php:4
 DONE
(0000439)
derick (administrator)
2006-08-19 14:26

This is how PHP's addcslashes does it as well. And as I use this internal function and it is more consistent I want to keep it this way. I'll update the test case though.

- Issue History
Date Modified Username Field Change
2006-05-19 07:39 judas_iscariote New Issue
2006-05-27 22:07 derick Status new => closed
2006-05-27 22:07 derick Note Added: 0000412
2006-05-28 04:19 judas_iscariote Status closed => feedback
2006-05-28 04:19 judas_iscariote Resolution open => reopened
2006-05-28 04:19 judas_iscariote Note Added: 0000416
2006-06-02 07:58 judas_iscariote Note Added: 0000418
2006-08-19 14:26 derick Status feedback => closed
2006-08-19 14:26 derick Note Added: 0000439


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker