MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000625XdebugUsage problems (Wrong Results)public2010-10-07 15:002012-12-18 12:36
Reporterjpic 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version2.2.2Fixed in Version2.2.2 
Summary0000625: xdebug_get_headers() -> Headers are reset unexpectedly.
DescriptionHeaders are emptied unexpectedly according to xdebug_get_headers().
Steps To Reproduce~ cat test_xdebug.php
<?php
header( 'Location: bar');
var_dump( xdebug_get_headers( ) );
header( 'HTTP/1.0 404 Not Found' );
var_dump( xdebug_get_headers( ) );


Expected result:

array(1) {
  [0]=>
  string(13) "Location: bar"
}
array(0) {
  [0]=>
  string(13) "Location: bar"
  [1]=>
  string(22) "HTTP/1.0 404 Not Found"
}

Actual result:

array(1) {
  [0]=>
  string(13) "Location: bar"
}
array(0) {
}
TagsNo tags attached.
Operating System
PHP Version5.2.8
Attached Files

- Relationships

-  Notes
(0001618)
whatthejeff (reporter)
2010-12-03 03:59

A suggested patch:

Index: xdebug.c
===================================================================
--- xdebug.c (revision 3374)
+++ xdebug.c (working copy)
@@ -1683,7 +1683,6 @@
         string = XDEBUG_LLIST_VALP(le);
         add_next_index_string(return_value, string, 1);
     }
- xdebug_llist_empty(XG(headers), NULL);
 }
 
 
Index: tests/bug00625.phpt
===================================================================
--- tests/bug00625.phpt (revision 0)
+++ tests/bug00625.phpt (revision 0)
@@ -0,0 +1,17 @@
+--TEST--
+Test for bug 0000625: xdebug_get_headers() -> Headers are reset unexpectedly.
+--FILE--
+<?php
+header('Foo:Bar');
+var_dump(xdebug_get_headers());
+var_dump(xdebug_get_headers());
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ string(7) "Foo:Bar"
+}
+array(1) {
+ [0]=>
+ string(7) "Foo:Bar"
+}
(0001752)
jpic (reporter)
2011-06-06 18:08

According to your patch, it looks more like a feature than a bug doesn't it ?
(0002392)
derick (administrator)
2012-12-17 20:03

Fixed for Xdebug 2.2.2.

- Issue History
Date Modified Username Field Change
2010-10-07 15:00 jpic New Issue
2010-12-03 03:59 whatthejeff Note Added: 0001618
2011-06-06 18:08 jpic Note Added: 0001752
2012-03-12 16:44 derick Target Version => 2.2.1
2012-07-14 23:14 derick Target Version 2.2.1 => 2.2.2
2012-12-17 20:03 derick Note Added: 0002392
2012-12-17 20:03 derick Status new => closed
2012-12-17 20:03 derick Assigned To => derick
2012-12-17 20:03 derick Resolution open => fixed
2012-12-18 12:36 derick Fixed in Version => 2.2.2
2016-07-31 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker