From 9632ea441b6828a54b6020f45da9c5c660c1b41c Mon Sep 17 00:00:00 2001 From: Hugues Peccatte Date: Sat, 5 Apr 2014 21:21:38 +0200 Subject: [PATCH] Fix undefined max_input_vars. Signed-off-by: Hugues Peccatte --- js/functions.js | 5 ++++- js/messages.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index 5e0427ac17..195feb211e 100644 --- a/js/functions.js +++ b/js/functions.js @@ -4117,6 +4117,9 @@ function checkNumberOfFields() { if (typeof maxInputVars === 'undefined') { return false; } + if (false === maxInputVars) { + return false; + } $('form').each(function() { var nbInputs = $(this).find(':input').length; if (nbInputs > maxInputVars) { @@ -4128,4 +4131,4 @@ function checkNumberOfFields() { }); return true; -} \ No newline at end of file +} diff --git a/js/messages.php b/js/messages.php index 55110be72d..a78ffa8f3e 100644 --- a/js/messages.php +++ b/js/messages.php @@ -424,7 +424,9 @@ echo "var pmaversion = '" . PMA_VERSION . "';\n"; echo "var mysql_doc_template = '" . PMA_Util::getMySQLDocuURL('%s') . "';\n"; //Max input vars allowed by PHP. -echo 'var maxInputVars = ' . ini_get('max_input_vars') . ';'; +$maxInputVars = ini_get('max_input_vars'); +echo 'var maxInputVars = ' . (false === $maxInputVars ? 'false' : $maxInputVars) + . ';'; echo "if ($.datepicker) {\n"; /* l10n: Display text for calendar close link */