Skip to content

Commit

Permalink
[BUGFIX] Prevent undefined array key warning
Browse files Browse the repository at this point in the history
Fixes: Yoast#565
  • Loading branch information
peterkraume committed Dec 6, 2023
1 parent 77b5100 commit 4e8b063
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Service/LinkingSuggestionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ protected function groupWordsByRecord(array $candidateWords): array
$candidateWordsByRecords = [];
foreach ($candidateWords as $candidateWord) {
$recordKey = $candidateWord['uid_foreign'] . '-' . $candidateWord['tablenames'];
if (!array_key_exists('weight', $candidateWord) || !array_key_exists('df', $candidateWord)) {
continue;
}
$candidateWordsByRecords[$recordKey][$candidateWord['stem']] = [
'weight' => (int)$candidateWord['weight'],
'df' => (int)$candidateWord['df']
Expand Down

0 comments on commit 4e8b063

Please sign in to comment.