[xdebug-dev] Bug 0000229: Cannot change a string to one which has spaces in it.

From: <noreply[@]lists.xdebug.org>
Date: Tue, 12 Dec 2006 22:28:30 +0100

A BUGNOTE has been added to this bug.
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000229
======================================================================
Reporter: d_kelsey
Handler:
======================================================================
Project: Xdebug
Bug ID: 229
Category: Usage problems
Reproducibility: always
Severity: minor
Priority: normal
Status: new
Operating System:
PHP Version: 5.1.6
Xdebug Version: 2.0.0rc1
======================================================================
Date Submitted: 2006-12-12 15:59 CET
Last Modified: 2006-12-12 22:28 CET
======================================================================
Summary: Cannot change a string to one which has spaces in it.
Description:
I attempt to change a variable containing a string (the string is
arbitrary) using the property_set request to a string which contains
spaces, but it fails. I can change the string to anything else so long as
it has no spaces in it.

eg I have a string with the contents "Welcome to PHP", and I tried to
change it to "This is", but it is rejected. The command issued is

property_set -i 189 -n $b -d 0 -l 12 -- VGhpcyBpcw==

<?xml version="1.0" encoding="iso-8859-1"?>
<response command="property_set" transaction_id="189"
success="0"></response>

If I change it to "ThisIsI" then the command is
property_set -i 193 -n $b -d 0 -l 12 -- VGhpc0lzSQ==

<?xml version="1.0" encoding="iso-8859-1"?>
<response command="property_set" transaction_id="193"
success="1"></response>

I have checked that the base64 encoding decodes correctly to a string with
spaces.
======================================================================

----------------------------------------------------------------------
 derick - 2006-12-12 22:28 CET
----------------------------------------------------------------------
Although property_set still needs some work, this is expected behavior.
Send the variable with quotes around it and it will work just fine.
Basically, Xdebug does internally:

$cmd = sprintf("%s = %s", $name, $data);
eval($cmd);

where $name is the -n option and $data the -- option. As you can see that
without the "'s, the eval command is not valid. I will keep this report
open though as a reminder to properly implement property_set.

Bug History
Date Modified Username Field Change
======================================================================
2006-12-12 15:59d_kelsey New Bug
2006-12-12 15:59d_kelsey Bug Monitored: d_kelsey
2006-12-12 22:28derick Bugnote Added: 0000520
======================================================================
Received on Tue Dec 12 2006 - 22:28:36 GMT

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