From: moodler Date: Sun, 1 Aug 2004 06:36:42 +0000 (+0000) Subject: Files starting with a slash are treated as URLs too X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=427c8ccb1aa25dd1bad301a18d17e01b1cac02df;p=moodle.git Files starting with a slash are treated as URLs too --- 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; } ?>