X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_country.php;h=5b227d84ce893aa7defa5e7460467be24e2e7ed5;hb=b9015c3fb6b46a770379c87561bdc65df4aca396;hp=16ceaef0bf65e6661699f66f2fa29efe8a2b8f2f;hpb=43885129ac24cee5545a8a5ad51e90aa182fdf46;p=mailer.git diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index 16ceaef0bf..5b227d84ce 100644 --- a/inc/modules/admin/what-list_country.php +++ b/inc/modules/admin/what-list_country.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -51,7 +50,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr' { // Save entry $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_countries (code, descr, is_active) - VALUES('%s', '%s', '%s')", + VALUES('%s','%s','%s')", array(strtoupper(substr($_POST['code'], 0, 2)), $_POST['descr'], $_POST['is_active']), __FILE__, __LINE__); // Country added @@ -104,7 +103,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr' // Edit all selected country codes $OUT = ""; $SW = 2; - foreach ($_POST['id'] as $id=>$status) + foreach ($_POST['id'] as $id => $status) { // Load data from DB $result = SQL_QUERY_ESC("SELECT code, descr FROM "._MYSQL_PREFIX."_countries WHERE id=%s LIMIT 1", @@ -125,7 +124,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr' if ($post == "modify") { // Generate default selection in edit-mode - $content['status'] = ADD_OPTION_LINES("/ARRAY/", array('Y', 'N'), array(YES, NO ), $status); + $content['status'] = ADD_OPTION_LINES("/ARRAY/", array("Y","N"), array(YES, NO ), $status); } else { @@ -154,7 +153,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr' if ((isset($_POST['modify'])) && (!empty($_POST['id']))) { // Modify - foreach ($_POST['id'] as $id=>$sel) + foreach ($_POST['id'] as $id => $sel) { $SQLs[] = "UPDATE "._MYSQL_PREFIX."_countries SET code='".$_POST['code'][$id]."', descr='".$_POST['descr'][$id]."', is_active='".$_POST['is_active'][$id]."' WHERE id='".$id."' LIMIT 1"; }