Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
e6986e5a
Commit
e6986e5a
authored
Jun 05, 2012
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1464244
by dawehner, tim.plunkett: Fixed Rewrite as URL adding equals sign to end of url.
parent
8c4df67a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
core/includes/common.inc
core/includes/common.inc
+1
-1
core/modules/system/tests/common.test
core/modules/system/tests/common.test
+27
-1
No files found.
core/includes/common.inc
View file @
e6986e5a
...
...
@@ -451,7 +451,7 @@ function drupal_get_query_array($query) {
if
(
!
empty
(
$query
))
{
foreach
(
explode
(
'&'
,
$query
)
as
$param
)
{
$param
=
explode
(
'='
,
$param
);
$result
[
$param
[
0
]]
=
isset
(
$param
[
1
])
?
rawurldecode
(
$param
[
1
])
:
''
;
$result
[
$param
[
0
]]
=
isset
(
$param
[
1
])
?
rawurldecode
(
$param
[
1
])
:
NULL
;
}
}
return
$result
;
...
...
core/modules/system/tests/common.test
View file @
e6986e5a
...
...
@@ -76,7 +76,7 @@ class CommonDrupalAlterTestCase extends WebTestBase {
* url() calls module_implements(), which may issue a db query, which requires
* inheriting from a web test case rather than a unit test case.
*/
class
CommonURL
Unit
TestCase
extends
WebTestBase
{
class
CommonURL
Web
TestCase
extends
WebTestBase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'URL generation tests'
,
...
...
@@ -280,6 +280,32 @@ class CommonURLUnitTestCase 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().
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment