Opened 3 years ago

Closed 3 years ago

#1486935 closed Feature Patches (fixed)

Missing variable for SET NAMES in squirrelmail_usercopy plugin

Reported by: Kepi Owned by:
Priority: 5 Milestone: 0.4.1
Component: Plugins Version: 0.4-stable
Severity: normal Keywords:
Cc:

Description

There is undefined variable $db_encoding which missing also in config. There is error in log about mysql error because 'set names;' doesn't exist.

From what I believe is correct, it is sufficient to use SET NAMES and forgot about SET CHARACTER SET at all.

So here is my proposed fix which use 'old' config option.

--- squirrelmail_usercopy.php.orig      2010-08-18 22:42:19.000000000 +0200
+++ squirrelmail_usercopy.php   2010-08-18 22:43:40.000000000 +0200
@@ -144,8 +144,7 @@
                        $address_table = $rcmail->config->get('squirrelmail_address_table');
                        $db_charset = $rcmail->config->get('squirrelmail_db_charset');
 
-                       $db->query('SET CHARACTER SET '.$db_charset);
-                       $db->query('SET NAMES '.$db_encoding);
+                       $db->query('SET NAMES '.$db_charset);
 
                        $sql_result = $db->query('SELECT * FROM '.$userprefs_table.' WHERE user=?', $uname); // ? is replaced with emailaddress

Change History (1)

comment:1 Changed 3 years ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r3899/svn

Note: See TracTickets for help on using tickets.