Skip to content
This repository
Browse code

Correct check for File subclass

  • Loading branch information...
commit b81386a431095f766575436f57c72cbaac7d492e 1 parent 9ecea76
Simon Welsh authored February 18, 2013

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  filesystem/File.php
2  filesystem/File.php
@@ -936,7 +936,7 @@ public static function set_class_for_file_extension($exts, $class) {
936 936
 		if(!is_array($exts)) $exts = array($exts);
937 937
 		
938 938
 		foreach($exts as $ext) {
939  
-			if(is_subclass_of($ext, 'File')) {
  939
+			if(!is_subclass_of($ext, 'File')) {
940 940
 				throw new InvalidArgumentException(
941 941
 					sprintf('Class "%s" (for extension "%s") is not a valid subclass of File', $class, $ext)
942 942
 				);

1 note on commit b81386a

Nik Rolls

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.
Something went wrong with that request. Please try again.