]> BookStack Code Mirror - bookstack/commitdiff
Fixed failing tests
authorDan Brown <redacted>
Sat, 24 Mar 2018 15:25:13 +0000 (15:25 +0000)
committerDan Brown <redacted>
Sat, 24 Mar 2018 15:25:13 +0000 (15:25 +0000)
Fixed syntax error in french translations.
Removed 'required' on image validation which was breaking tests

app/Http/Controllers/ImageController.php
app/Providers/AppServiceProvider.php
resources/lang/fr/entities.php

index 9782a94c42dfcbbb39a8b23690d3f7c34cc57708..8437c80d71d1ac58b1565fcc56fc66be45a63af0 100644 (file)
@@ -120,7 +120,7 @@ class ImageController extends Controller
     {
         $this->checkPermission('image-create-all');
         $this->validate($request, [
-            'file' => 'required|image'
+            'file' => 'is_image'
         ]);
 
         if (!$this->imageRepo->isValidType($type)) {
@@ -136,6 +136,7 @@ class ImageController extends Controller
             return response($e->getMessage(), 500);
         }
 
+
         return response()->json($image);
     }
 
index 57e5c8ed5a50ec88f65637dc454921d1094c0afb..b06b2f3a25b992322b8172e110f0ecd3ef447cab 100644 (file)
@@ -15,7 +15,7 @@ class AppServiceProvider extends ServiceProvider
     public function boot()
     {
         // Custom validation methods
-        Validator::extend('image', function ($attribute, $value, $parameters, $validator) {
+        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);
         });
index 011d8678c42fb814cce0c189e383c043cd734b92..7d0696c2a710e99063eac26901b7a5f29597c2dd 100644 (file)
@@ -63,7 +63,7 @@ return [
     'search_created_before' => 'Créé avant',
     'search_created_after' => 'Créé après',
     'search_set_date' => 'Choisir la date',
-    'search_update' => 'Actualiser la recherche'
+    'search_update' => 'Actualiser la recherche',
 
     /**
      * Books