Permalink
Browse files

Correct check for File subclass

  • Loading branch information...
1 parent 9ecea76 commit b81386a431095f766575436f57c72cbaac7d492e @simonwelsh simonwelsh committed Feb 18, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 filesystem/File.php
View
@@ -936,7 +936,7 @@ public static function set_class_for_file_extension($exts, $class) {
if(!is_array($exts)) $exts = array($exts);
foreach($exts as $ext) {
- if(is_subclass_of($ext, 'File')) {
+ if(!is_subclass_of($ext, 'File')) {
throw new InvalidArgumentException(
sprintf('Class "%s" (for extension "%s") is not a valid subclass of File', $class, $ext)
);

1 comment on commit b81386a

@nikrolls
Contributor

This is still incorrect, though I take the blame for missing out the ! to begin with (I submitted the last patch).

I've come across this again today, and realised we should be checking $class, not $ext.

Please sign in to comment.