diff --git a/www/install/php/Update-19.04.5.php b/www/install/php/Update-19.04.5.php index abbee2effd7..8827e4b40c3 100644 --- a/www/install/php/Update-19.04.5.php +++ b/www/install/php/Update-19.04.5.php @@ -64,16 +64,17 @@ // correct the DN of manually imported users from an LDAP try { // finding the data of contacts linked to an LDAP - $stmt = $this->pearDB->query( + $stmt = $pearDB->query( "SELECT contact_id, contact_name, contact_ldap_dn FROM contact WHERE ar_id is NOT NULL" ); + $updateDB = $pearDB->prepare( + "UPDATE contact SET contact_ldap_dn = :newDn WHERE contact_id = :contactId" + ); while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { // removing the double slashes if needed and saving the corrected data if (strpos($row['contact_ldap_dn'], "\\\\")) { $newDn = str_replace("\\\\", "\\", $row['contact_ldap_dn']); - $updateDB = $this->pearDB->prepare( - "UPDATE contact SET contact_ldap_dn = :newDn WHERE contact_id = :contactId" - ); + $updateDB->bindValue(':newDn', $newDn, \PDO::PARAM_STR); $updateDB->bindValue(':contactId', $row['contact_id'], \PDO::PARAM_INT); $updateDB->execute();