Skip to content

Commit

Permalink
Merge pull request #2500 from nextcloud/fix/2487-access-id-only-if-ex…
Browse files Browse the repository at this point in the history
…isting

Fix the access to the array entry if not existing
  • Loading branch information
christianlupus committed Sep 15, 2024
2 parents 3da909e + a3199df commit de953ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/current/2500-fix-accedd-to-unknown-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Fixed

- Do not access unknown ID of recipe while importing
4 changes: 3 additions & 1 deletion lib/Helper/Filter/JSON/RecipeIdTypeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class RecipeIdTypeFilter extends AbstractJSONFilter {
public function apply(array &$json): bool {
$copy = $json;
$json['id'] = strval($json['id']);
if(array_key_exists('id', $json)) {
$json['id'] = strval($json['id']);
}
return $json !== $copy;
}
}

0 comments on commit de953ef

Please sign in to comment.