Update to Language code #2

Open
wants to merge 3 commits into
from
@@ -18,7 +18,7 @@
switch ($action) {
case 'insert':
$name = tep_db_prepare_input($HTTP_POST_VARS['name']);
- $code = tep_db_prepare_input(substr($HTTP_POST_VARS['code'], 0, 2));
+ $code = tep_db_prepare_input($HTTP_POST_VARS['code'], 0, 5));
$image = tep_db_prepare_input($HTTP_POST_VARS['image']);
$directory = tep_db_prepare_input($HTTP_POST_VARS['directory']);
$sort_order = (int)tep_db_prepare_input($HTTP_POST_VARS['sort_order']);
@@ -71,7 +71,7 @@
case 'save':
$lID = tep_db_prepare_input($HTTP_GET_VARS['lID']);
$name = tep_db_prepare_input($HTTP_POST_VARS['name']);
- $code = tep_db_prepare_input(substr($HTTP_POST_VARS['code'], 0, 2));
+ $code = tep_db_prepare_input(substr($HTTP_POST_VARS['code'], 0, 5));
$image = tep_db_prepare_input($HTTP_POST_VARS['image']);
$directory = tep_db_prepare_input($HTTP_POST_VARS['directory']);
$sort_order = (int)tep_db_prepare_input($HTTP_POST_VARS['sort_order']);
@@ -49,6 +49,7 @@
if (tep_not_null($action)) {
switch ($action) {
case 'save':
+ reset($_POST['configuration']);
while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
}
@@ -240,7 +240,7 @@ DROP TABLE IF EXISTS languages;
CREATE TABLE languages (
languages_id int NOT NULL auto_increment,
name varchar(32) NOT NULL,
- code char(2) NOT NULL,
+ code char(5) NOT NULL,
image varchar(64),
directory varchar(32),
sort_order int(3),