From 030abc511430327aedd764e1486e9c5bb24efbda Mon Sep 17 00:00:00 2001 From: Crack Date: Tue, 13 Jul 2010 23:15:22 +0200 Subject: [PATCH] add missing validation for TextareaRows fix warning in FormDisplay while importing settings --- .gsoc/todo.txt | 5 +---- libraries/config.values.php | 1 + libraries/config/FormDisplay.class.php | 4 +++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gsoc/todo.txt b/.gsoc/todo.txt index 579ab144b..625cf1862 100644 --- a/.gsoc/todo.txt +++ b/.gsoc/todo.txt @@ -2,7 +2,4 @@ restore cache'ing in phpmyadmin.css.php make CSS for darkblue_orange check input escaping, $cfg is no longer safe to use -preference: -- synchronize language, theme ThemeDefault - -allow to import ThemeDefault +local storage - autoload? diff --git a/libraries/config.values.php b/libraries/config.values.php index e0f4101e8..77ce1a671 100644 --- a/libraries/config.values.php +++ b/libraries/config.values.php @@ -130,5 +130,6 @@ $cfg_db['_validators'] = array( 'Servers/1/port' => 'validate_port_number', 'Servers/1/hide_db' => 'validate_regex', 'TextareaCols' => 'validate_positive_number', + 'TextareaRows' => 'validate_positive_number', 'TrustedProxies' => 'validate_trusted_proxies'); ?> \ No newline at end of file diff --git a/libraries/config/FormDisplay.class.php b/libraries/config/FormDisplay.class.php index ef8592a9c..1234e01c7 100644 --- a/libraries/config/FormDisplay.class.php +++ b/libraries/config/FormDisplay.class.php @@ -528,7 +528,9 @@ class FormDisplay break; case 'array': // eliminate empty values and ensure we have an array - $post_values = explode("\n", $_POST[$key]); + $post_values = is_array($_POST[$key]) + ? $_POST[$key] + : explode("\n", $_POST[$key]); $_POST[$key] = array(); foreach ($post_values as $v) { $v = trim($v);