diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-10-15 20:00:19 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-10-15 20:00:19 +0000 |
commit | d692d438a36a6dede50813e01cf96155617c3f18 (patch) | |
tree | d2bf08af8a260489821e89e074c2bbbbfcbf0a96 | |
parent | 8d74e4c1324842cf8416ab17808a2ff2fb33d669 (diff) | |
download | brdo-d692d438a36a6dede50813e01cf96155617c3f18.tar.gz brdo-d692d438a36a6dede50813e01cf96155617c3f18.tar.bz2 |
- Patch #82741 by Wesley: fixed incorrect comparison in url().
-rw-r--r-- | includes/common.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc index c32bee9d8..4b47f92cb 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -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 ':'. if (strpos($path, ':') !== FALSE && filter_xss_bad_protocol($path, FALSE) == check_plain($path)) { // Split off the fragment - if (strpos($path, '#')) { + if (strpos($path, '#') !== FALSE) { list($path, $old_fragment) = explode('#', $path, 2); if (isset($old_fragment) && !isset($fragment)) { $fragment = '#'. $old_fragment; @@ -1030,7 +1030,7 @@ function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) { } // Append the query if (isset($query)) { - $path .= (strpos($path, '?') ? '&' : '?') . $query; + $path .= (strpos($path, '?') !== FALSE ? '&' : '?') . $query; } // Reassemble return $path . $fragment; |