Validator error for file restrictions

Validator error for file restrictions

mfitportalmfitportal Posts: 12Questions: 5Answers: 0
edited January 8 in DataTables

I am using the editor for a site that I am working on and I came across this error
Illegal string offset 'name' in ..\Editor\Validate.php on line 1064
I'm unsure why this error is occurring as the validate file should be up to date. For the server side script, I followed the example that is posted on the site. I'll put the segment of code that it is referring to.

[Code]
```
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* File validation methods
*/
static function fileExtensions ( $extensions, $msg="This file type cannot be uploaded." ) {
return function ( $file ) use ( $extensions, $msg ) {
$extn = pathinfo($file['name'], PATHINFO_EXTENSION);

        for ( $i=0, $ien=count($extensions) ; $i<$ien ; $i++ ) {
            if ( strtolower( $extn ) === strtolower( $extensions[$i] ) ) {
                return true;
            }
        }

        return $msg;
    };
}

static function fileSize ( $size, $msg="Uploaded file is too large." ) {
    return function ( $file ) use ( $size, $msg ) {
        return $file['size'] > $size ?
            $msg :
            true;
    };
}

``` [/Code]

Answers

  • j92694j92694 Posts: 1Questions: 0Answers: 0

    I am getting the same error message.

  • mfitportalmfitportal Posts: 12Questions: 5Answers: 0

    I believe it is a bug within the system, hopefully they recognize it soon.

Sign In or Register to comment.