aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2017-11-27 22:48:17 +0100
committerKevin Decherf <kevin@kdecherf.com>2017-12-10 18:22:41 +0100
commit6c5904ba7fd0e3e62aebebfa07185dba73f68d6b (patch)
tree4ea6221175a27b780ade0fe4e0e0149a6b821610 /app/DoctrineMigrations
parente9a4231d4f39c5d330d581113f577ff3ef1a3cf9 (diff)
downloadwallabag-6c5904ba7fd0e3e62aebebfa07185dba73f68d6b.tar.gz
wallabag-6c5904ba7fd0e3e62aebebfa07185dba73f68d6b.tar.zst
wallabag-6c5904ba7fd0e3e62aebebfa07185dba73f68d6b.zip
Replace raw query with named parameter
Fix possible issue with special chars on #3139 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'app/DoctrineMigrations')
-rw-r--r--app/DoctrineMigrations/Version20170719231144.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/DoctrineMigrations/Version20170719231144.php b/app/DoctrineMigrations/Version20170719231144.php
index 0c749150..265b539a 100644
--- a/app/DoctrineMigrations/Version20170719231144.php
+++ b/app/DoctrineMigrations/Version20170719231144.php
@@ -42,12 +42,13 @@ class Version20170719231144 extends AbstractMigration implements ContainerAwareI
42 $label = $duplicates['LOWER(label)']; 42 $label = $duplicates['LOWER(label)'];
43 43
44 // Retrieve all duplicate tags for a given tag 44 // Retrieve all duplicate tags for a given tag
45 $tags = $this->connection->query(' 45 $tags = $this->connection->createQuery('
46 SELECT id 46 SELECT id
47 FROM ' . $this->getTable('tag') . " 47 FROM ' . $this->getTable('tag') . "
48 WHERE LOWER(label) = '" . $label . "' 48 WHERE LOWER(label) = :label
49 ORDER BY id ASC" 49 ORDER BY id ASC"
50 ); 50 );
51 $tags->setParameter('label', $label);
51 $tags->execute(); 52 $tags->execute();
52 53
53 $first = true; 54 $first = true;