- Patch #82741 by Wesley: fixed incorrect comparison in url().
parent
8d74e4c132
commit
d692d438a3
|
@ -1022,7 +1022,7 @@ function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) {
|
||||||
// Only call the slow filter_xss_bad_protocol if $path contains a ':'.
|
// Only call the slow filter_xss_bad_protocol if $path contains a ':'.
|
||||||
if (strpos($path, ':') !== FALSE && filter_xss_bad_protocol($path, FALSE) == check_plain($path)) {
|
if (strpos($path, ':') !== FALSE && filter_xss_bad_protocol($path, FALSE) == check_plain($path)) {
|
||||||
// Split off the fragment
|
// Split off the fragment
|
||||||
if (strpos($path, '#')) {
|
if (strpos($path, '#') !== FALSE) {
|
||||||
list($path, $old_fragment) = explode('#', $path, 2);
|
list($path, $old_fragment) = explode('#', $path, 2);
|
||||||
if (isset($old_fragment) && !isset($fragment)) {
|
if (isset($old_fragment) && !isset($fragment)) {
|
||||||
$fragment = '#'. $old_fragment;
|
$fragment = '#'. $old_fragment;
|
||||||
|
@ -1030,7 +1030,7 @@ function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) {
|
||||||
}
|
}
|
||||||
// Append the query
|
// Append the query
|
||||||
if (isset($query)) {
|
if (isset($query)) {
|
||||||
$path .= (strpos($path, '?') ? '&' : '?') . $query;
|
$path .= (strpos($path, '?') !== FALSE ? '&' : '?') . $query;
|
||||||
}
|
}
|
||||||
// Reassemble
|
// Reassemble
|
||||||
return $path . $fragment;
|
return $path . $fragment;
|
||||||
|
|
Loading…
Reference in New Issue