mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-23 23:29:59 +08:00
Expanded chapters interface and improved book/page deletion
This commit is contained in:
@ -53,10 +53,10 @@ class ChapterRepo
|
||||
return $query->count() > 0;
|
||||
}
|
||||
|
||||
public function findSuitableSlug($name, $bookId)
|
||||
public function findSuitableSlug($name, $bookId, $currentId = false)
|
||||
{
|
||||
$slug = Str::slug($name);
|
||||
while($this->doesSlugExist($slug, $bookId)) {
|
||||
while($this->doesSlugExist($slug, $bookId, $currentId)) {
|
||||
$slug .= '-' . substr(md5(rand(1, 500)), 0, 3);
|
||||
}
|
||||
return $slug;
|
||||
|
Reference in New Issue
Block a user