Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-41634 - URL Download Repository doesn't warn when asked to downlo…

…ad non-image files
  • Loading branch information...
commit 4342b9320dcf2f8420234e91fd47da081de9db2d 1 parent 7952a76
Matt N. mnoorenberghe authored samhemelryk committed
1  repository/url/lang/en/repository_url.php
@@ -30,3 +30,4 @@
30 30 $string['url:view'] = 'Use URL downloader in file picker';
31 31 $string['validname'] = 'You must provide a valid file name';
32 32 $string['configplugin'] = 'URL repository type configuration';
  33 +$string['validfiletype'] = 'You must provide a URL to an image file or a page containing images.';
2  repository/url/lib.php
@@ -168,6 +168,8 @@ protected function parse_file($baseurl, $relativeurl, &$list, $mainfile = false)
168 168 } else if (strstr($info['content_type'], 'image/')) {
169 169 // download this file
170 170 $this->add_image_to_list($info['url'], $info['url'], $list);
  171 + } else {
  172 + $list['error'] = get_string('validfiletype', 'repository_url');
171 173 }
172 174
173 175 // parse all found css styles

0 comments on commit 4342b93

Please sign in to comment.
Something went wrong with that request. Please try again.