From: Roland Häder Date: Sat, 7 Mar 2009 07:19:03 +0000 (+0000) Subject: Removed all LIMIT x statements from extension removal queries, several minor fixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9d527cf8f2d95f7f58a42cb159f0ffc732f49d39;p=mailer.git Removed all LIMIT x statements from extension removal queries, several minor fixes --- diff --git a/inc/extensions.php b/inc/extensions.php index 1fd297707c..5e94c32dc3 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -138,6 +138,21 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr // Is this extension already installed? if (EXT_IS_ACTIVE($ext_name)) return false; + // Is the task id zero? Then we need to auto-fix it here + if ($task_id == 0) { + // Try to find the task + $task_id = DETERMINE_EXTENSION_TASK_ID($ext_name); + + // Still zero and not in dry-run? + if (($task_id == 0) && (!$dry_run)) { + // Then request a bug report + debug_report_bug(sprintf("%s: task_id is still zero after DETERMINE_EXTENSION_TASK_ID(%s)", + __FUNCTION__, + $ext_name + )); + } // END - if + } // END - if + // Init queries INIT_SQLS(); diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php index 61a3106a8b..66494ef924 100644 --- a/inc/extensions/ext-active.php +++ b/inc/extensions/ext-active.php @@ -57,8 +57,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='active' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_active' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='active'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_active'"); // Unregister filter UNREGISTER_FILTER('online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, $dry_run); diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 39402c318f..0d31836fd9 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -59,7 +59,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='admins' LIMIT 6"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='admins'"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_acls`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_mails`"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP default_acl"); diff --git a/inc/extensions/ext-admintheme1.php b/inc/extensions/ext-admintheme1.php index ae20abaa72..55729a2b42 100644 --- a/inc/extensions/ext-admintheme1.php +++ b/inc/extensions/ext-admintheme1.php @@ -53,9 +53,9 @@ switch ($EXT_LOAD_MODE) case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Remove all other themes ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name LIKE 'admintheme%'"); - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='usr_online' LIMIT 1"); - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='email_stats' LIMIT 1"); - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='misc' WHERE `what`='maintenance' LIMIT 1"); + ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='usr_online'"); + ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='email_stats'"); + ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='misc' WHERE `what`='maintenance'"); break; case "remove": // Do stuff when removing extension diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index baf29106b8..4542fb18a1 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -66,7 +66,7 @@ case "remove": // Do stuff when removing extension { ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` MODIFY data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'"); } - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_autopurge','list_autopurge') LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_autopurge','list_autopurge')"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP ap_notified"); break; diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index eaf7987b07..1e507a8a3e 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -160,8 +160,8 @@ case "remove": // Do stuff when removing extension ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_transfers`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_packages`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_tanlist`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='bank' LIMIT 14"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='bank' LIMIT 8"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='bank'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='bank'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index 59cf530771..af774a5d66 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -72,9 +72,9 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_beg' OR `what`='list_beg' LIMIT 2"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='beg' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='beg' OR `what`='beg2' LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_beg' OR `what`='list_beg'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='beg'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='beg' OR `what`='beg2'"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_beg_ips`"); break; diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index 18d328c256..ffbfc09f50 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -59,7 +59,7 @@ case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP birthday_sent"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_birthday`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_birthday' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_birthday'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 17ec62a7a0..d2459f3306 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -82,9 +82,9 @@ PRIMARY KEY (id) case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications') LIMIT 5"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='bonus' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='bonus' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications')"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='bonus'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='bonus'"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` MODIFY link_type ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL'"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` DROP bonus_id"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus`"); diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index 03d109f82d..e8f107978b 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -77,8 +77,8 @@ PRIMARY KEY(`id`) case "remove": // Do stuff when removing extension ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_book`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN ('config_booking','list_booking') LIMIT 2"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='booking' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN ('config_booking','list_booking')"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='booking'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 887639c770..fcf7e910a0 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -61,7 +61,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_cache' OR `what`='cache_stats' LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_cache','cache_stats')"); // Unregister all filters UNREGISTER_FILTER('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 3f8702a5f7..2d5ecdaa20 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -74,7 +74,7 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='country' LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='country'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 07a2b73308..848c541560 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -141,8 +141,8 @@ case "remove": // Do stuff when removing extension ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_client`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_log`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_log_abuse`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='debug' LIMIT 5"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='debug' LIMIT 6"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='debug'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='debug'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index cafcd848dc..0bf3f2b987 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -120,9 +120,9 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_doubler`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='doubler' LIMIT 3"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='doubler' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='doubler' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='doubler'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='doubler'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='doubler'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index fc9de447c4..9dd2d099ea 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -63,7 +63,7 @@ case "remove": // Do stuff when removing extension ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP html"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` DROP html_msg"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_pool` DROP html_msg"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='html_mail' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='html_mail'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-logs.php b/inc/extensions/ext-logs.php index 8099c4b424..34c56bc53f 100644 --- a/inc/extensions/ext-logs.php +++ b/inc/extensions/ext-logs.php @@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='logs' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='logs'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-maintenance.php b/inc/extensions/ext-maintenance.php index 0aa42ad113..2d5c8d7c45 100644 --- a/inc/extensions/ext-maintenance.php +++ b/inc/extensions/ext-maintenance.php @@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='maintenance' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='maintenance'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index d9147d1003..eb5df54436 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -58,8 +58,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_mediadata`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_mediadata' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='mediadata' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_mediadata'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='mediadata'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-mods.php b/inc/extensions/ext-mods.php index 2e969a917a..19bfafd837 100644 --- a/inc/extensions/ext-mods.php +++ b/inc/extensions/ext-mods.php @@ -59,7 +59,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='mods' LIMIT 3"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='mods'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index ac8d48eb41..0b24623f8a 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -57,8 +57,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='newsletter' AND what != 'send_newsletter' LIMIT 3"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='newsletter' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='newsletter' AND what != 'send_newsletter'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='newsletter'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index 6f6632ef99..b195767493 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -59,8 +59,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='nickname' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname') LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='nickname'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname')"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`"); break; diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index 1aa0222162..9d87ada42d 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -76,8 +76,8 @@ KEY `admin_member` (`is_admin`,`is_member`) case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_online`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usr_online' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='online' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usr_online'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='online'"); // Unregister filter UNREGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', true, $dry_run); diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index 97fc30939b..5dd1f18341 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -63,7 +63,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_optimize_gain`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='optimize' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='optimize'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 9dca71ddce..43fbadf439 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -57,7 +57,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php index 5a97a870ab..99a94cb16e 100644 --- a/inc/extensions/ext-other.php +++ b/inc/extensions/ext-other.php @@ -57,7 +57,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_other' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_other'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index 55e3476a7e..4b1f7d4e49 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -84,7 +84,7 @@ case "remove": // Do stuff when removing extension ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_payouts`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_payout_types`"); ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='payouts'"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='payout' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='payout'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index 169ea946a6..db02d3f7a8 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -84,7 +84,7 @@ case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_primera`"); ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='primera'"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='primera' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='primera'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index 83fa1cf8d8..336eb3a2ad 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -109,9 +109,9 @@ case "remove": // Do stuff when removing extension ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_users`"); // Remove menus - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='rallye' LIMIT 4"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='rallyes' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='rallyes' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='rallye'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='rallyes'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='rallyes'"); // Unregister filter UNREGISTER_FILTER('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, $dry_run); diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index 32aa44cf01..8f5c9ba985 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -71,8 +71,8 @@ KEY (`refid`) case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_refs`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='refback' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_refback','list_refback') LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='refback'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_refback','list_refback')"); ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET level=level-1"); break; diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index 947e997eeb..823d933323 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -57,7 +57,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_register' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_register'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-removeip.php b/inc/extensions/ext-removeip.php index 11b7f14983..1e0eb3611b 100644 --- a/inc/extensions/ext-removeip.php +++ b/inc/extensions/ext-removeip.php @@ -66,7 +66,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_removeip' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_removeip'"); // Remove filters UNREGISTER_FILTER('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, $dry_run); diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php index 8a48615bd4..197f1a6192 100644 --- a/inc/extensions/ext-repair.php +++ b/inc/extensions/ext-repair.php @@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='repair' LIMIT 5"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='repair'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php index 63f7076e9d..28a8eca22f 100644 --- a/inc/extensions/ext-rewrite.php +++ b/inc/extensions/ext-rewrite.php @@ -63,7 +63,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_rewrite' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_rewrite'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index a3eca42a99..61a4fde77e 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -383,9 +383,9 @@ case "remove": // Do stuff when removing extension ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_campaign_assigns`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_admin_data`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_display_data`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='sponsor' LIMIT 5"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='sponsor' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd')"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='sponsor'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='sponsor'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index e6b870aa4d..3dc39325bd 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -93,6 +93,7 @@ action='rals' OR action='account'"); // Drop indexes + /* @TODO SQL_ALTER_TABLE() should work now properly ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` DROP UNIQUE KEY `ext_name`"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP UNIQUE KEY `login`"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status`"); @@ -124,6 +125,7 @@ action='account'"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `locked`"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_cats` DROP INDEX `visible`"); ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_cats` DROP INDEX `sort`"); + */ break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 2d02c54206..e84a1a708d 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -200,8 +200,8 @@ case "remove": // Do stuff when removing extension ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_salts`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_stats`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_urls`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='surfbar' LIMIT 5"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='surfbar' LIMIT 7"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='surfbar'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='surfbar'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-task.php b/inc/extensions/ext-task.php index ced2cc5ac1..6ddbc4234e 100644 --- a/inc/extensions/ext-task.php +++ b/inc/extensions/ext-task.php @@ -59,7 +59,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='task' LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='task'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index 6de24ad2bf..ae9421a980 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -59,13 +59,13 @@ case "remove": // Do stuff when removing extension ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`"); // Delete admin menu - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme' LIMIT 4"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme'"); // Delete guest menu entries - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='themes' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='themes'"); // Delete member menu entries - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='themes' OR `what`='themes' LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='themes' OR `what`='themes'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-top10.php b/inc/extensions/ext-top10.php index b31a07f5ad..f0ebdd9b27 100644 --- a/inc/extensions/ext-top10.php +++ b/inc/extensions/ext-top10.php @@ -59,8 +59,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='top10' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_top10' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='top10'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_top10'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 55dec050cf..2bbb4818f0 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -107,9 +107,9 @@ case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_in`"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_out`"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='transfer' LIMIT 4"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='transfer' LIMIT 1"); - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP opt_in"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='transfer'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='transfer'"); + ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP `opt_in`"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-usage.php b/inc/extensions/ext-usage.php index 1547c4aa70..035f5cc3be 100644 --- a/inc/extensions/ext-usage.php +++ b/inc/extensions/ext-usage.php @@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usage' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usage'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 53495b76c8..b75d24da39 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -66,7 +66,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') LIMIT 3"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_del`"); break; diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index db288ccae6..76c1663dcd 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -87,8 +87,8 @@ case "remove": // Do stuff when removing extension // SQL commands to run ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_wernis`"); ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='wernis'"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='wernis' LIMIT 1"); - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='wernis_portal' LIMIT 1"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='wernis'"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='wernis_portal'"); break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 92acaf61a7..54171376a0 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -86,7 +86,7 @@ UNIQUE `y_type` (`type`,`y_id`) case "remove": // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm') LIMIT 2"); + ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm')"); ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_yoomedia_reload`"); break; diff --git a/inc/install-inc.php b/inc/install-inc.php index 2cc38fa24d..06c7e1fc72 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -47,7 +47,7 @@ if (!defined('__SECURITY')) { } // Init variables -$mysql = ""; +$mysql = array(); if ((REQUEST_ISSET_POST(('mysql'))) && (is_array(REQUEST_POST('mysql')))) $mysql = REQUEST_POST('mysql'); // Check if both passwords from SMTP are matching diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index bd0d9351cd..d668fbaacd 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -1251,6 +1251,16 @@ function ADMIN_DELETE_TASK ($id) { } // Function to update task data function ADMIN_UPDATE_TASK_DATA ($id, $row, $data) { + // Is the id not set, then we need a backtrace here... :( + if ($id <= 0) { + // Initiate backtrace + debug_report_bug(sprintf("id is invalid: %s. row=%s, data=%s", + $id, + $row, + $data + )); + } // END - if + // Update the task SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET %s='%s' WHERE id=%s LIMIT 1", array($row, $data, bigintval($id)), __FUNCTION__, __LINE__);