From 59d0a9fe8670e0ff01e4a38f991f4a71cd118f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 10 Jul 2017 15:26:47 +0200 Subject: [PATCH] Add sanity checking for max_count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We use it later for division, so make sure it's good for it. Fixes #13470 Signed-off-by: Michal Čihař --- libraries/Util.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/Util.php b/libraries/Util.php index d1be48b662..f9e4938641 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -2408,6 +2408,13 @@ class Util $classes = array() ) { + // This is often coming from $cfg['MaxTableList'] and + // people sometimes set it to empty string + $max_count = intval($max_count); + if ($max_count <= 0) { + $max_count = 250; + } + $class = $frame == 'frame_navigation' ? ' class="ajax"' : ''; $list_navigator_html = '';