From b93113d24d7e206bd89de8064f7e31ebc9d44564 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 1 Oct 2006 01:28:18 +0000 Subject: [PATCH] r1219: By using a L_INVALID_ID constant, we can blow off loading the Localize module --- admin/permission.php | 2 +- admin/product.php | 8 ++++---- attachment.php | 4 ++-- editreport.php | 2 +- includes/init.php | 1 - includes/language.php | 2 +- showhistory.php | 2 +- showreport.php | 4 ++-- viewattachment.php | 2 +- vote.php | 4 ++-- 10 files changed, 15 insertions(+), 16 deletions(-) diff --git a/admin/permission.php b/admin/permission.php index 4e22cb2..1d89b4a 100755 --- a/admin/permission.php +++ b/admin/permission.php @@ -104,7 +104,7 @@ if ($_REQUEST['do'] == 'edit') if (!$usergroup OR !$product) { - $admin->error($lang->getlex('error_invalid_id')); + $admin->error(L_INVALID_ID); } $admin->page_start(_('Edit Permissions')); diff --git a/admin/product.php b/admin/product.php index 117d036..67f9ae7 100755 --- a/admin/product.php +++ b/admin/product.php @@ -120,7 +120,7 @@ if ($_REQUEST['do'] == 'addversion') $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); if (!is_array($product)) { - $admin->error($lang->getlex('error_invalid_id')); + $admin->error(L_INVALID_ID); } } else @@ -165,7 +165,7 @@ if ($_REQUEST['do'] == 'editversion') $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "version WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT)); if (!is_array($version)) { - $admin->error($lang->getlex('error_invalid_id')); + $admin->error(L_INVALID_ID); } $admin->form_start('product.php', 'updateversion'); @@ -271,7 +271,7 @@ if ($_REQUEST['do'] == 'updateproduct') if (empty($bugsys->in['productid'])) { - $admin->error($lang->getlex('error_invalid_id')); + $admin->error(L_INVALID_ID); } $db->query("UPDATE " . TABLE_PREFIX . "product SET title = '" . $bugsys->input_escape('title') . "', description = '" . $bugsys->input_escape('description') . "', displayorder = " . $bugsys->input_clean('displayorder', TYPE_UINT) . " WHERE productid = " . $bugsys->input_clean('productid', TYPE_UINT)); @@ -292,7 +292,7 @@ if ($_REQUEST['do'] == 'editproduct') $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); if (!is_array($product)) { - $admin->error($lang->getlex('error_invalid_id')); + $admin->error(L_INVALID_ID); } $admin->form_start('product.php', 'updateproduct'); diff --git a/attachment.php b/attachment.php index 5d6dde9..017141b 100755 --- a/attachment.php +++ b/attachment.php @@ -41,14 +41,14 @@ if (isset($bugsys->in['attachmentid'])) $attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $bugsys->input_clean('attachmentid', TYPE_UINT)); if (!$attachment) { - $message->error($lang->getlex('error_invalid_id')); + $message->error(L_INVALID_ID); } } $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . (($attachment['attachmentid']) ? $attachment['bugid'] : $bugsys->input_clean('bugid', TYPE_UINT))); if (!$bug) { - $message->error($lang->getlex('error_invalid_id')); + $message->error(L_INVALID_ID); } if (!check_bug_permissions($bug)) diff --git a/editreport.php b/editreport.php index 6cd39be..5e1423c 100644 --- a/editreport.php +++ b/editreport.php @@ -44,7 +44,7 @@ $bug = $db->query_first(" if (!$bug) { - $message->error($lang->getlex('error_invalid_id')); + $message->error(L_INVALID_ID); } if (!check_bug_permissions($bug)) diff --git a/includes/init.php b/includes/init.php index e190961..8dc9605 100755 --- a/includes/init.php +++ b/includes/init.php @@ -128,7 +128,6 @@ if (!$userinfo) // ################################################################### // initialize localization system -$bugsys->load('localize', 'lang', true); require_once('./includes/language.php'); diff --git a/includes/language.php b/includes/language.php index 205792f..3d9af25 100644 --- a/includes/language.php +++ b/includes/language.php @@ -36,7 +36,7 @@ if (!function_exists('gettext')) // ################################################################### // LEXICAL STRING CONSTANTS -$lang->setlex('error_invalid_id', _('That is an invalid ID.')); +define('L_INVALID_ID', _('That is an invalid ID.')); // ################################################################### // determines the user's language diff --git a/showhistory.php b/showhistory.php index f404cf2..94b4b49 100644 --- a/showhistory.php +++ b/showhistory.php @@ -34,7 +34,7 @@ require_once('./includes/api_user.php'); $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->input_clean('bugid', TYPE_UINT)); if (!$bug) { - $message->error($lang->getlex('error_invalid_id')); + $message->error(L_INVALID_ID); } if (!check_bug_permissions($bug)) diff --git a/showreport.php b/showreport.php index 71e40a5..11a1bb7 100644 --- a/showreport.php +++ b/showreport.php @@ -49,7 +49,7 @@ if (empty($bugid) OR $_REQUEST['do'] == 'quicksearch') } else { - $error = $lang->getlex('error_invalid_id'); + $error = L_INVALID_ID; } } @@ -81,7 +81,7 @@ $show['delete'] = can_perform('candeletedata', $bug['product']); if (!is_array($bug)) { - $message->error($lang->getlex('error_invalid_id')); + $message->error(L_INVALID_ID); } if (!check_bug_permissions($bug)) diff --git a/viewattachment.php b/viewattachment.php index 70df0fc..2d8fc0f 100755 --- a/viewattachment.php +++ b/viewattachment.php @@ -30,7 +30,7 @@ require_once('./global.php'); $attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $bugsys->input_clean('attachmentid', TYPE_UINT)); if (!$attachment) { - $message->error($lang->getlex('error_invalid_id')); + $message->error(L_INVALID_ID); } $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $attachment[bugid]"); diff --git a/vote.php b/vote.php index 6105872..f58a295 100644 --- a/vote.php +++ b/vote.php @@ -29,7 +29,7 @@ require_once('./global.php'); if (empty($_REQUEST['do'])) { - $message->error($lang->getlex('error_invalid_id')); + $message->error(L_INVALID_ID); } // ################################################################### @@ -51,7 +51,7 @@ if ($_REQUEST['do'] == 'vote') if (!$bug) { - $message->error($lang->getlex('error_invalid_id')); + $message->error(L_INVALID_ID); } if ($vote['uservote']) -- 2.43.5