diff --git a/repository/url/lang/en/repository_url.php b/repository/url/lang/en/repository_url.php index defc6aa1a3e..2714500c416 100644 --- a/repository/url/lang/en/repository_url.php +++ b/repository/url/lang/en/repository_url.php @@ -30,3 +30,4 @@ $string['url'] = 'URL'; $string['url:view'] = 'Use URL downloader in file picker'; $string['validname'] = 'You must provide a valid file name'; $string['configplugin'] = 'URL repository type configuration'; +$string['validfiletype'] = 'You must provide a URL to an image file or a page containing images.'; diff --git a/repository/url/lib.php b/repository/url/lib.php index 45a5b3fb948..daf057b0d00 100644 --- a/repository/url/lib.php +++ b/repository/url/lib.php @@ -168,6 +168,8 @@ EOD; } else if (strstr($info['content_type'], 'image/')) { // download this file $this->add_image_to_list($info['url'], $info['url'], $list); + } else { + $list['error'] = get_string('validfiletype', 'repository_url'); } // parse all found css styles