Revert "Issue #1464244 by dawehner, tim.plunkett: Fixed Rewrite as URL adding equals sign to end of url."
This reverts commit e6986e5a48
.
8.0.x
parent
33e8b1b57e
commit
ff639ed52c
|
@ -451,7 +451,7 @@ function drupal_get_query_array($query) {
|
||||||
if (!empty($query)) {
|
if (!empty($query)) {
|
||||||
foreach (explode('&', $query) as $param) {
|
foreach (explode('&', $query) as $param) {
|
||||||
$param = explode('=', $param);
|
$param = explode('=', $param);
|
||||||
$result[$param[0]] = isset($param[1]) ? rawurldecode($param[1]) : NULL;
|
$result[$param[0]] = isset($param[1]) ? rawurldecode($param[1]) : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|
|
@ -76,7 +76,7 @@ class CommonDrupalAlterTestCase extends WebTestBase {
|
||||||
* url() calls module_implements(), which may issue a db query, which requires
|
* url() calls module_implements(), which may issue a db query, which requires
|
||||||
* inheriting from a web test case rather than a unit test case.
|
* inheriting from a web test case rather than a unit test case.
|
||||||
*/
|
*/
|
||||||
class CommonURLWebTestCase extends WebTestBase {
|
class CommonURLUnitTestCase extends WebTestBase {
|
||||||
public static function getInfo() {
|
public static function getInfo() {
|
||||||
return array(
|
return array(
|
||||||
'name' => 'URL generation tests',
|
'name' => 'URL generation tests',
|
||||||
|
@ -280,32 +280,6 @@ class CommonURLWebTestCase extends WebTestBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for non-DB based URL generation functions.
|
|
||||||
*/
|
|
||||||
class CommonUrlUnitTestCase extends UnitTestBase {
|
|
||||||
|
|
||||||
public static function getInfo() {
|
|
||||||
return array(
|
|
||||||
'name' => 'URL generation tests',
|
|
||||||
'description' => 'Confirm that drupal_get_query_array() works correctly with various input.',
|
|
||||||
'group' => 'Common',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests drupal_get_query_array().
|
|
||||||
*/
|
|
||||||
function testDrupalGetQueryArray() {
|
|
||||||
$this->assertEqual(drupal_get_query_array('foo=bar'), array('foo' => 'bar'), 'Simple value works as expected.');
|
|
||||||
$this->assertEqual(drupal_get_query_array('foo=1'), array('foo' => '1'), 'Numeric value works as expected.');
|
|
||||||
$this->assertEqual(drupal_get_query_array('foo=1&bar=baz'), array('foo' => '1', 'bar' => 'baz'), 'Multiple values are parsed as well.');
|
|
||||||
$this->assertEqual(drupal_get_query_array('foo='), array('foo' => ''), 'An empty value is set as an empty string.');
|
|
||||||
$this->assertEqual(drupal_get_query_array('foo'), array('foo' => NULL), 'No value is set as a null value.');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for check_plain(), filter_xss(), format_string(), and check_url().
|
* Tests for check_plain(), filter_xss(), format_string(), and check_url().
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue