X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-repair_amenu.php;h=83f62f7017d944d24b5217cc46e0aa3f405e275d;hb=22a33b87f9894a94efb71de7630f12129e34f83b;hp=b9479f4e21ce8485e2bfead3d3b2053a67652bf6;hpb=963e55ca1ea79e255f235e359cde9f7862191dc5;p=mailer.git diff --git a/inc/modules/admin/what-repair_amenu.php b/inc/modules/admin/what-repair_amenu.php index b9479f4e21..83f62f7017 100644 --- a/inc/modules/admin/what-repair_amenu.php +++ b/inc/modules/admin/what-repair_amenu.php @@ -38,18 +38,19 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { } // Add description as navigation point -ADD_DESCR("admin", basename(__FILE__)); +ADD_DESCR("admin", __FILE__); $ACTIONS = array(); // First fix all main menus (what="")... -$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); +$result_fix = SQL_QUERY("SELECT id, action FROM `"._MYSQL_PREFIX."_admin_menu` WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; while(list($id, $act) = SQL_FETCHROW($result_fix)) { // Store act value for later usage in sorting sub menus $ACTIONS[] = $act; // Fix weight - $result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='".$cnt."' WHERE id='".$id."' LIMIT 1", __FILE__, __LINE__); + $result_sort = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_admin_menu` SET sort=%s WHERE id=%s LIMIT 1", + array($cnt, $id), __FILE__, __LINE__); $REP += SQL_AFFECTEDROWS(); // Count one up @@ -57,17 +58,17 @@ while(list($id, $act) = SQL_FETCHROW($result_fix)) { } // Set logout weight to 999 -$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE act='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); +$result_sort = SQL_QUERY("UPDATE `"._MYSQL_PREFIX."_admin_menu` SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu -foreach ($ACTIONS as $act) -{ - $result_fix = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE act='".$act."' AND what != '' AND what IS NOT NULL ORDER BY sort", __FILE__, __LINE__); +foreach ($ACTIONS as $act) { + $result_fix = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort", + array($act), __FILE__, __LINE__); $cnt = 1; - while (list($id) = SQL_FETCHROW($result_fix)) - { + while (list($id) = SQL_FETCHROW($result_fix)) { // Fix weight - $result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='".$cnt."' WHERE id='".$id."' LIMIT 1", __FILE__, __LINE__); + $result_sort = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_admin_menu` SET sort=%s WHERE id=%s LIMIT 1", + array($cnt, $id), __FILE__, __LINE__); $REP += SQL_AFFECTEDROWS(); // Count one up