]> _ Git - cubist_util.git/commitdiff
wait #8045 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Mar 2026 11:44:21 +0000 (12:44 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Mar 2026 11:44:21 +0000 (12:44 +0100)
src/Url.php

index d95d25d155f582a20fe09a29421e40c9f249b024..5506ebb172662753acbf68983dd50a4f61fd7b8c 100644 (file)
@@ -4,7 +4,7 @@ namespace Cubist\Util;
 class Url
 {
 
-    public static function isLocal($url, $site_url = null)
+    public static function isLocal($url, $site_url = null,$localSchemes=['javascript'])
     {
         if (null !== $site_url && strpos($url, $site_url) === 0) {
             return true;
@@ -14,7 +14,7 @@ class Url
             return false;
         }
         $u = parse_url($url);
-        return !(isset($u['scheme']) && $u['scheme'] != '');
+        return !(isset($u['scheme']) && $u['scheme'] != '' && !in_array($u['scheme'], $localSchemes));
     }
 
     public static function extractPathComponents($path)