]> git.mjollnir.org Git - moodle.git/commitdiff
Files starting with a slash are treated as URLs too
authormoodler <moodler>
Sun, 1 Aug 2004 06:36:42 +0000 (06:36 +0000)
committermoodler <moodler>
Sun, 1 Aug 2004 06:36:42 +0000 (06:36 +0000)
mod/resource/lib.php

index c4f2568274b2ed8f46df9d33f548ae93fa49c966..72818924f24f0e6ec14f7f3d93308405a410cba0 100644 (file)
@@ -468,11 +468,13 @@ function resource_redirect_tags($text, $url, $tagtoparse, $keytoparse,$prefix =
 }
 
 function resource_is_url($path) {
-    if (strpos($path, '://')) {
+    if (strpos($path, '://')) {     // eg http:// https:// ftp://  etc
         return true;
-    } else {
-        return false;
     }
+    if (strpos($path, '/') === 0) { // Starts with slash
+        return true;
+    }
+    return false;
 }
 
 ?>