]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Repos/BaseRepo.php
Added test & update to prevent page creation w/ empty slug
[bookstack] / app / Entities / Repos / BaseRepo.php
index cfde7fe1c578eb6876b1e77237c86e74bb584493..747d1b17644cbf0846f8176b622c62338bd79fc5 100644 (file)
@@ -56,7 +56,7 @@ class BaseRepo
         $entity->fill($input);
         $entity->updated_by = user()->id;
 
-        if ($entity->isDirty('name')) {
+        if ($entity->isDirty('name') || empty($entity->slug)) {
             $entity->refreshSlug();
         }