Commit 42a085c8 authored by Dries's avatar Dries

- Patch #18437 by Mathias: Drupal doesn't allow URL aliases that map to...

- 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.
parent 344f33f6
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment