diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b49c03c5..04508fed1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ [#1000](https://github.com/nextcloud/cookbook/pull/1000) @seyfeb - Reenable the fixup action after deprecation in central repository [#1012](https://github.com/nextcloud/cookbook/pull/1012) @christianlupus +- Trim recipe name to a maximum length to fit in the database + [#1014](https://github.com/nextcloud/cookbook/pull/1014) @christianlupus - Update eslint-plugin-vue ### Documentation diff --git a/lib/Service/RecipeService.php b/lib/Service/RecipeService.php index 50aa37d10..41f62c77f 100755 --- a/lib/Service/RecipeService.php +++ b/lib/Service/RecipeService.php @@ -149,6 +149,11 @@ public function checkRecipe(array $json): array { // Make sure that "name" doesn't have any funky characters in it $json['name'] = $this->cleanUpString($json['name'], false, true); + // Restrict the length of the name to be not longer than what the DB can store + if (strlen($json['name']) > 256) { + $json['name'] = substr($json['name'], 0, 256); + } + // Make sure that "image" is a string of the highest resolution image available if (isset($json['image']) && $json['image']) { if (is_array($json['image'])) {