mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Correct check for File subclass
This commit is contained in:
parent
9ecea763c3
commit
b81386a431
@ -936,7 +936,7 @@ class File extends DataObject {
|
|||||||
if(!is_array($exts)) $exts = array($exts);
|
if(!is_array($exts)) $exts = array($exts);
|
||||||
|
|
||||||
foreach($exts as $ext) {
|
foreach($exts as $ext) {
|
||||||
if(is_subclass_of($ext, 'File')) {
|
if(!is_subclass_of($ext, 'File')) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
sprintf('Class "%s" (for extension "%s") is not a valid subclass of File', $class, $ext)
|
sprintf('Class "%s" (for extension "%s") is not a valid subclass of File', $class, $ext)
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user