View Issue Details

IDProjectCategoryView StatusLast Update
0000445XdebugUncategorizedpublic2009-07-05 22:20
Reporterkent Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.0.0dev 
Summary0000445: error_prepend_string and error_append_string are ignored by xdebug_error_cb
Description

xdebug_error_cb does not output PHP ini settings error_prepend_string, or error_append_string

Additional Information

On our developement systems, we use a specially crafted error_prepend_string and error_append_string to both highlight errors on scripts, but also as a means of automated testing using Selenium. When a specific error string is output on a web page, we can automatically detect the error on PHP pages.

Since we have recently switched to Xdebug and Netbeans, the errors were not being detected, and after investigation it turns out the Xdebug was the culprit.

The fix is simple. The following patch can be applied to xdebug.c version 2.0.4:

1812a1813,1814

  char * prepend_string;
  char * append_string;

1820c1822,1823
< xdebug_str_add(&str, formats[0], 0);

    prepend_string = INI_STR("error_prepend_string");
    append_string = INI_STR("error_append_string");

1821a1825,1826
xdebug_str_add(&str, prepend_string ? prepend_string : "", 0);
xdebug_str_add(&str, formats[0], 0);
1953a1959
xdebug_str_add(&str, append_string ? append_string : "", 0);

It mostly patches the get_printable_stack function.

Thanks for a great tool!

TagsNo tags attached.
Operating SystemFreeBSD 7.2 RELEASE
PHP Version5.2.8

Activities

derick

2009-06-21 00:18

administrator   ~0000967

Could you please attach the patch (please make with diff -u) as file to this report?

kent

2009-06-22 01:38

reporter   ~0000969

Last edited: 2009-06-22 01:41

I don't have permission to upload, I think... Can you grant me permission first?

derick

2009-07-05 22:20

administrator   ~0000979

Fixed in CVS (for Xdebug 2.1 only) and thanks for the patch!