1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Fixed error on image deletion

Also Added tests to cover image upload and deletion.
Fixes #136.
This commit is contained in:
Dan Brown
2016-07-01 20:11:49 +01:00
parent 361ba8b244
commit 7b6c88f17c
7 changed files with 124 additions and 13 deletions

View File

@ -15,7 +15,12 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//
// Custom validation methods
\Validator::extend('is_image', function($attribute, $value, $parameters, $validator) {
$imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
return in_array($value->getMimeType(), $imageMimes);
});
}
/**