Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/Service/RecipeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down