]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/ImageRepo.php
Modernize third party services' logos
[bookstack] / app / Uploads / ImageRepo.php
index e76a0a97d8384d4057f88a6182115e13c30d2b73..694560a14ca752994a1a2508f43ddb6d2a5740dc 100644 (file)
@@ -35,10 +35,12 @@ class ImageRepo
 
     /**
      * Check if the given image extension is supported by BookStack.
+     * The extension must not be altered in this function. This check should provide a guarantee
+     * that the provided extension is safe to use for the image to be saved.
      */
     public function imageExtensionSupported(string $extension): bool
     {
-        return in_array(trim($extension, ". \t\n\r\0\x0B"), static::$supportedExtensions);
+        return in_array($extension, static::$supportedExtensions);
     }
 
     /**