Even more rewrites/fixes from EL branch (please report any broken part after you...
[mailer.git] / inc / modules / admin / what-repair_gmnu.php
index d2d4a027c8b44c1d1b46269903f7c1c8eebe7331..63a9f4413ce8cc675bed9770b46e1fb78871be41 100644 (file)
@@ -54,7 +54,10 @@ while ($content = SQL_FETCHARRAY($result_fix)) {
        $ACTIONS[] = $content['action'];
 
        // Fix weight
        $ACTIONS[] = $content['action'];
 
        // Fix weight
-       $result_sort = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET sort='".$cnt."' WHERE `id`='".$content['id']."' LIMIT 1", __FILE__, __LINE__);
+       $result_sort = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `sort`='%s WHERE `id`=%s' LIMIT 1",
+               array($cnt, $content['id']), __FILE__, __LINE__);
+
+       // Get updated rows
        $REP += SQL_AFFECTEDROWS();
 
        // Count one up
        $REP += SQL_AFFECTEDROWS();
 
        // Count one up
@@ -67,7 +70,7 @@ $result_sort = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET sort='999' W
 // Now sort every each menu
 foreach ($ACTIONS as $action) {
        $result_fix = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
 // Now sort every each menu
 foreach ($ACTIONS as $action) {
        $result_fix = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
-       array($action), __FILE__, __LINE__);
+               array($action), __FILE__, __LINE__);
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result_fix)) {
                // Fix weight
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result_fix)) {
                // Fix weight