We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b55775 commit a0a90f8Copy full SHA for a0a90f8
server/actions/patterns/multiFavorite.php
@@ -25,15 +25,19 @@ class multiFavorite extends \core\AbstractAction {
25
26
public function execute() {
27
$urlIds = $this->getValue("patternIds");
28
- $userProfile = $this->getUserProfile();
29
30
- $idList = quoteStringArray($urlIds);
+ // Each id needs to be a number.
+ $idList = quoteStringArray(array_map(function($id) {
31
+ return intval($id);
32
+ }, $urlIds));
33
34
$existingIds = $this->db->query("SELECT id FROM patterns WHERE id IN ($idList)");
35
$cleanIds = [];
36
37
if (!is_null($existingIds)) {
38
$idList = [];
39
+ $userProfile = $this->getUserProfile();
40
+
41
for ($i=0; $i < count($existingIds); $i++) {
42
$id = $existingIds[$i]->id;
43
$cleanIds[] = convertToURL($id);
0 commit comments