diff options
-rw-r--r-- | language/en_UK.iso-8859-1/common.lang.php | 2 | ||||
-rw-r--r-- | language/fr_FR.iso-8859-1/common.lang.php | 2 | ||||
-rw-r--r-- | profile.php | 15 |
3 files changed, 17 insertions, 2 deletions
diff --git a/language/en_UK.iso-8859-1/common.lang.php b/language/en_UK.iso-8859-1/common.lang.php index 39dbf5ad4..b9383d624 100644 --- a/language/en_UK.iso-8859-1/common.lang.php +++ b/language/en_UK.iso-8859-1/common.lang.php @@ -218,7 +218,9 @@ $lang['month'][9] = 'September'; $lang['most_visited_cat'] = 'Most visited'; $lang['most_visited_cat_hint'] = 'displays most visited pictures'; $lang['nb_image_per_row'] = 'Number of images per row'; +$lang['nb_image_line_error'] = 'The number of images per row must be a not null scalar'; $lang['nb_row_per_page'] = 'Number of rows per page'; +$lang['nb_line_page_error'] = 'The number of rows per page must be a not null scalar'; $lang['never_rated'] = 'You\'ve never rated this item'; $lang['new_password'] = 'New password'; $lang['new_password_hint'] = 'You only have to give a password if you wish to change it.'; diff --git a/language/fr_FR.iso-8859-1/common.lang.php b/language/fr_FR.iso-8859-1/common.lang.php index 4227b2598..8bf262f8b 100644 --- a/language/fr_FR.iso-8859-1/common.lang.php +++ b/language/fr_FR.iso-8859-1/common.lang.php @@ -217,7 +217,9 @@ $lang['month'][9] = 'Septembre'; $lang['most_visited_cat'] = 'Plus vues'; $lang['most_visited_cat_hint'] = 'afficher les images les plus vues'; $lang['nb_image_per_row'] = 'Nombre de miniatures par ligne'; +$lang['nb_image_line_error'] = 'Le nombre d\'images par ligne doit être un entier non nul'; $lang['nb_row_per_page'] = 'Nombre de lignes par page'; +$lang['nb_line_page_error'] = 'Le nombre de lignes par page doit être un entier non nul'; $lang['never_rated'] = 'Vous n\'avez jamais voté pour cette image'; $lang['new_password'] = 'Nouveau mot de passe'; $lang['new_password_hint'] = 'Vous n\'avez à confirmer votre mot de passe que si vous désirez en changer.'; diff --git a/profile.php b/profile.php index 2aab4c05d..8c4db8fce 100644 --- a/profile.php +++ b/profile.php @@ -47,6 +47,17 @@ $errors = array(); if (isset($_POST['validate'])) { $int_pattern = '/^\d+$/'; + if (empty($_POST['nb_image_line']) + or (!preg_match($int_pattern, $_POST['nb_image_line']))) + { + array_push($errors, $lang['nb_image_line_error']); + } + + if (empty($_POST['nb_line_page']) + or (!preg_match($int_pattern, $_POST['nb_line_page']))) + { + array_push($errors, $lang['nb_line_page_error']); + } if ($_POST['maxwidth'] != '' and (!preg_match($int_pattern, $_POST['maxwidth']) @@ -128,13 +139,13 @@ SELECT '.$conf['user_fields']['password'].' AS password ); $data = array(); - $data{'user_id'} = $_POST['userid']; + $data['user_id'] = $_POST['userid']; foreach ($fields as $field) { if (isset($_POST[$field])) { - $data{$field} = $_POST[$field]; + $data[$field] = $_POST[$field]; } } mass_updates(USER_INFOS_TABLE, |