From 427c8ccb1aa25dd1bad301a18d17e01b1cac02df Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 1 Aug 2004 06:36:42 +0000 Subject: [PATCH] Files starting with a slash are treated as URLs too --- mod/resource/lib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/resource/lib.php b/mod/resource/lib.php index c4f2568274..72818924f2 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -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; } ?> -- 2.39.5