protected $restrictionService;
protected $page;
+ protected static $supportedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
+
/**
* ImageRepo constructor.
*/
$this->page = $page;
}
+ /**
+ * Check if the given image extension is supported by BookStack.
+ */
+ public function imageExtensionSupported(string $extension): bool
+ {
+ return in_array(trim($extension, '. \t\n\r\0\x0B'), static::$supportedExtensions);
+ }
+
/**
* Get an image with the given id.
*/