summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 22b93767a..cf194cbc5 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -963,6 +963,7 @@ function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) {
}
$path = drupal_get_path_alias($path);
+ $path = drupal_urlencode($path);
if (isset($fragment)) {
$fragment = '#'. $fragment;
@@ -1251,13 +1252,15 @@ function drupal_implode_autocomplete($array) {
/**
* Wrapper around urlencode() which avoids Apache quirks.
*
- * Should be used when placing arbitrary data inside the path of a clean URL.
+ * Should be used when placing arbitrary data in an URL. Note that Drupal paths
+ * are urlencoded() when passed through url() and do not require urlencoding()
+ * of individual components.
*
* @param $text
* String to encode
*/
function drupal_urlencode($text) {
- return variable_get('clean_url', '0') ? str_replace('%2F', '/', urlencode($text)) : urlencode($text);
+ return str_replace('%2F', '/', urlencode($text));
}
/**