Browse Source
Fixed bug #26819 (http_build_query() crashes on NULL output).
Fixed bug #26819 (http_build_query() crashes on NULL output).
Fixed bug #26817 (http_build_query() does not handle private & protected object properties correctly).PEAR_1_4DEV
5 changed files with 66 additions and 8 deletions
-
3NEWS
-
33ext/standard/http.c
-
3ext/standard/php_http.h
-
26ext/standard/tests/strings/bug26817.phpt
-
9ext/standard/tests/strings/bug26819.phpt
@ -0,0 +1,26 @@ |
|||
--TEST-- |
|||
Bug #26817 (http_build_query() did not handle private & protected object properties) |
|||
--FILE-- |
|||
<?php |
|||
class test { |
|||
protected $foo; |
|||
private $bar; |
|||
public $test; |
|||
|
|||
function foo() |
|||
{ |
|||
$this->bar = 'meuh'; |
|||
$this->foo = 'lala'; |
|||
$this->test = 'test'; |
|||
|
|||
var_dump(http_build_query($this)); |
|||
} |
|||
} |
|||
|
|||
$obj = new test(); |
|||
$obj->foo(); |
|||
var_dump(http_build_query($obj)); |
|||
?> |
|||
--EXPECT-- |
|||
string(27) "foo=lala&bar=meuh&test=test" |
|||
string(9) "test=test" |
|||
@ -0,0 +1,9 @@ |
|||
--TEST-- |
|||
Bug #26819 (http_build_query() crash on empty output) |
|||
--FILE-- |
|||
<?php |
|||
$a = array(); |
|||
var_dump(http_build_query($a)); |
|||
?> |
|||
--EXPECT-- |
|||
NULL |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue