[GSFile] Fix sanitize configuration
This commit is contained in:
@@ -55,6 +55,22 @@ class VideoEncoder extends Plugin
|
||||
return '1.0.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $event_map
|
||||
* @param string $mimetype
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function onFileMetaAvailable(array &$event_map, string $mimetype): bool
|
||||
{
|
||||
if (GSFile::mimetypeMajor($mimetype) !== 'video' && $mimetype !== 'image/gif') {
|
||||
return Event::next;
|
||||
}
|
||||
$event_map['video'][] = [$this, 'fileMeta'];
|
||||
$event_map['image/gif'][] = [$this, 'fileMeta'];
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $event_map
|
||||
* @param string $mimetype
|
||||
@@ -66,8 +82,8 @@ class VideoEncoder extends Plugin
|
||||
if (GSFile::mimetypeMajor($mimetype) !== 'video' && $mimetype !== 'image/gif') {
|
||||
return Event::next;
|
||||
}
|
||||
$event_map['video'][] = [$this, 'fileSanitize'];
|
||||
$event_map['image/gif'][] = [$this, 'fileSanitize'];
|
||||
$event_map['video'][] = [$this, 'fileMeta'];
|
||||
$event_map['image/gif'][] = [$this, 'fileMeta'];
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
@@ -97,7 +113,7 @@ class VideoEncoder extends Plugin
|
||||
*
|
||||
* @return bool true if sanitized
|
||||
*/
|
||||
public function fileSanitize(SplFileInfo &$file, ?string &$mimetype, ?int &$width, ?int &$height): bool
|
||||
public function fileMeta(SplFileInfo &$file, ?string &$mimetype, ?int &$width, ?int &$height): bool
|
||||
{
|
||||
if (//GSFile::mimetypeMajor($mimetype) !== 'video' &&
|
||||
$mimetype !== 'image/gif') {
|
||||
|
Reference in New Issue
Block a user