diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-03-06 06:57:58 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-03-06 06:57:58 +0000 |
commit | 42a085c8add0db708d848cfc79c7aa8fe2e0587a (patch) | |
tree | 7a7e6a537a2e6149b3a68c09efba9166005df2ba | |
parent | 344f33f6af7ad9739913d932b73d8d6575aafff8 (diff) | |
download | brdo-42a085c8add0db708d848cfc79c7aa8fe2e0587a.tar.gz brdo-42a085c8add0db708d848cfc79c7aa8fe2e0587a.tar.bz2 |
- Patch #18437 by Mathias: Drupal doesn't allow URL aliases that map to Userland Manila posts since they usually contain the '$' and are considered an invalid URL. This patch allows '$' in an URL and thus an alias. It also resolves a disparity between the 'allowable characters' of absolute and relative URLs. As far as I can tell, those parts of the regexp should be the same.
-rw-r--r-- | includes/common.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc index a15bee61c..f326bdeca 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -596,11 +596,12 @@ function valid_email_address($mail) { * TRUE if the URL is in a valid format. */ function valid_url($url, $absolute = FALSE) { + $allowed_characters = '[a-z0-9\/:_\-_\.\?\$,~=#&%\+]'; if ($absolute) { - return preg_match("/^(http|https|ftp):\/\/[a-z0-9\/:_\-_\.\?,~=#&%\+]+$/i", $url); + return preg_match("/^(http|https|ftp):\/\/". $allowed_characters ."+$/i", $url); } else { - return preg_match("/^[a-z0-9\/:_\-_\.,\+]+$/i", $url); + return preg_match("/^". $allowed_characters ."+$/i", $url); } } |