Remove parse_str() its buggy and wrong.

parse_str() replaces `.` with _ and drops duplicated keys, which is
incorrect.  Replace parse_str with an updated version of parseQuery
from 1.x

Fixes #2629
Fixes #2647
This commit is contained in:
mark_story 2012-03-08 21:05:28 -05:00
parent 621b086d9c
commit 150c9fc6a3
2 changed files with 61 additions and 2 deletions

View file

@ -1450,7 +1450,15 @@ class HttpSocketTest extends CakeTestCase {
),
'empty' => ''
);
$this->assertEquals($query, $expectedQuery);
$this->assertEquals($expectedQuery, $query);
$query = 'openid.ns=example.com&foo=bar&foo=baz';
$result = $this->Socket->parseQuery($query);
$expected = array(
'openid.ns' => 'example.com',
'foo' => array('bar', 'baz')
);
$this->assertEquals($expected, $result);
}
/**