]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Harmonize, clarify, categorize URL schemes
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 24 Jan 2016 11:47:31 +0000 (12:47 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 24 Jan 2016 11:47:31 +0000 (12:47 +0100)
Regular expression + avoid-redirection list now match each other.

classes/File_redirection.php
lib/util.php

index 491353a214e8c91d5391619b1ed769c6a5bf89e0..a1956f173af34e2ad8b4eabead6d269274ca8f01 100644 (file)
@@ -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);
index 14de5bed739c3a8891c8902bf5729e2024044f92..5d1559d4d7309e98bda3d5c8775cd79032c2ad38 100644 (file)
@@ -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@
                 '(?:'.