From: Mikael Nordfeldth Date: Sun, 24 Jan 2016 11:47:31 +0000 (+0100) Subject: Harmonize, clarify, categorize URL schemes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a9d18a077eca2db07b2f44e17f2a6a1b95d197bd;p=quix0rs-gnu-social.git Harmonize, clarify, categorize URL schemes Regular expression + avoid-redirection list now match each other. --- diff --git a/classes/File_redirection.php b/classes/File_redirection.php index 491353a214..a1956f173a 100644 --- a/classes/File_redirection.php +++ b/classes/File_redirection.php @@ -312,15 +312,20 @@ class File_redirection extends Managed_DataObject $out_url = str_replace('.-()', '', $out_url); break; + // non-HTTP schemes, so no redirects case 'bitcoin': case 'mailto': - case 'magnet': case 'aim': case 'jabber': case 'xmpp': // don't touch anything break; + // URLs without domain name, so no redirects + case 'magnet': + // don't touch anything + break; + default: $out_url = $default_scheme . ltrim($out_url, '/'); $p = parse_url($out_url); diff --git a/lib/util.php b/lib/util.php index 14de5bed73..5d1559d4d7 100644 --- a/lib/util.php +++ b/lib/util.php @@ -885,7 +885,7 @@ function common_replace_urls_callback($text, $callback, $arg = null) { '(?:'. '(?:(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|ircs?)://)'. '|'. - '(?:(?:bitcoin|mailto|aim|tel|xmpp):)'. + '(?:(?:aim|bitcoin|fax|jabber|mailto|tel|xmpp):)'. ')'. '(?:[\pN\pL\-\_\+\%\~]+(?::[\pN\pL\-\_\+\%\~]+)?\@)?'. //user:pass@ '(?:'.