Skip to content

Commit

Permalink
Why do it twice?
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannon committed Apr 15, 2024
1 parent fea55d4 commit 527c90d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions autocomplete_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@
}

$data = $sug = [];
for ($i = 0; $i < count ($ret); $i++) {
$sug[$i] = $ret[$i]['name'];
}
for ($i = 0; $i < count ($ret); $i++) {
$data[$i] = $ret[$i]['text'];

foreach ( $ret as $i ) {
$sug[] = $i['name'];
$data[] = $i['text'];
}

ajax_send_object('matches', $sug, $sendPlainText);
} else {
ajax_send_error(translate("Error"));
Expand Down

0 comments on commit 527c90d

Please sign in to comment.