From 28270d7d1894f25f78e404d436ba7800c3ef25d3 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Mon, 27 Oct 2014 10:27:37 +0000 Subject: [PATCH] Use named placeholders in "update_group" function --- src/mibew/libs/groups.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/mibew/libs/groups.php b/src/mibew/libs/groups.php index 5416e22b..24ef2906 100644 --- a/src/mibew/libs/groups.php +++ b/src/mibew/libs/groups.php @@ -381,24 +381,24 @@ function update_group($group) $db = Database::getInstance(); $db->query( ("UPDATE {opgroup} SET " - . "parent = ?, vclocalname = ?, vclocaldescription = ?, " - . "vccommonname = ?, vccommondescription = ?, " - . "vcemail = ?, vctitle = ?, vcchattitle = ?, " - . "vchosturl = ?, vclogo = ?, iweight = ? " - . "where groupid = ?"), + . "parent = :parent, vclocalname = :name, vclocaldescription = :desc, " + . "vccommonname = :common_name, vccommondescription = :common_desc, " + . "vcemail = :email, vctitle = :title, vcchattitle = :chat_title, " + . "vchosturl = :host_url, vclogo = :logo, iweight = :weight " + . "where groupid = :id"), array( - ($group['parent'] ? (int) $group['parent'] : null), - $group['vclocalname'], - $group['vclocaldescription'], - $group['vccommonname'], - $group['vccommondescription'], - $group['vcemail'], - $group['vctitle'], - $group['vcchattitle'], - $group['vchosturl'], - $group['vclogo'], - $group['iweight'], - $group['groupid'] + ':parent' => ($group['parent'] ? (int) $group['parent'] : null), + ':name' => $group['vclocalname'], + ':desc' => $group['vclocaldescription'], + ':common_name' => $group['vccommonname'], + ':common_desc' => $group['vccommondescription'], + ':email' => $group['vcemail'], + ':title' => $group['vctitle'], + ':chat_title' => $group['vcchattitle'], + ':host_url' => $group['vchosturl'], + ':logo' => $group['vclogo'], + ':weight' => $group['iweight'], + ':id' => $group['groupid'], ) );