A free, self-hostable news aggregator…
Fix adding categories in MySQL 5.5 (#2672)
Alexandre Alapetite1ddf98c50b2e
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.phpindex 08dc4eef0..4bba23d9c 100644--- a/app/Models/CategoryDAO.php+++ b/app/Models/CategoryDAO.php@@ -81,7 +81,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchablepublic function addCategory($valuesTmp) {$sql = 'INSERT INTO `_category`(name, attributes) '- . 'SELECT * FROM (SELECT TRIM(?), ?) c2 ' //TRIM() to provide a type hint as text for PostgreSQL+ . 'SELECT * FROM (SELECT TRIM(?) AS name, TRIM(?) AS attributes) c2 ' //TRIM() to provide a type hint as text. 'WHERE NOT EXISTS (SELECT 1 FROM `_tag` WHERE name = TRIM(?))'; //No tag of the same name$stm = $this->pdo->prepare($sql);