Even more rewrites/fixes from EL branch (please report any broken part after you...
[mailer.git] / inc / modules / admin / what-repair_gmnu.php
index ec446f9d8e8e1db0dc89e4ac1d5d2ac906e93d36..63a9f4413ce8cc675bed9770b46e1fb78871be41 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -53,7 +54,10 @@ while ($content = SQL_FETCHARRAY($result_fix)) {
        $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
@@ -66,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`",
-       array($action), __FILE__, __LINE__);
+               array($action), __FILE__, __LINE__);
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result_fix)) {
                // Fix weight