From 6f765606b8e8340cda254a806c6f30cb201fc74b Mon Sep 17 00:00:00 2001 From: GrillGuth Date: Wed, 13 Sep 2017 01:03:53 +0200 Subject: [PATCH] fixing suhosin check 2 When using empty($max) the follwowing two expression need to be switched. If Suhosin is not installed @ini_get('suhosin.post.max_vars') and @ini_get('suhosin.request.max_vars') will return false. empty($max) will return true and count($dnsarray) should be set as $max. ...Took me only one year to notice I missed that change here. --- stuff/admin/voice_tsdns.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stuff/admin/voice_tsdns.php b/stuff/admin/voice_tsdns.php index 2691daef..98432483 100644 --- a/stuff/admin/voice_tsdns.php +++ b/stuff/admin/voice_tsdns.php @@ -234,7 +234,7 @@ if ($ui->w('action',4, 'post') and !token(true)) { $maxRequests = @ini_get('suhosin.request.max_vars'); $i = 0; $max = ($maxRequests and $maxPost and $maxPost<$maxRequests) ? $maxPost : $maxRequests; - $max = (empty($max)) ? ($max-10)/7 : count($dnsarray); + $max = (empty($max)) ? count($dnsarray) : ($max-10)/7; $dnsarray = tsdns('li', $ssh2ip, $ssh2port, $ssh2user, $publickey, $keyname, $ssh2password, 'N', $serverdir, $bit, array(''), array(''), array(''), $reseller_id); @@ -305,7 +305,7 @@ if ($ui->w('action',4, 'post') and !token(true)) { $maxRequests = @ini_get('suhosin.request.max_vars'); $i = 0; $max = ($maxRequests and $maxPost and $maxPost<$maxRequests) ? $maxPost : $maxRequests; - $max = (empty($max)) ? ($max-10)/7 : count($dnsarray); + $max = (empty($max)) ? count($dnsarray) : ($max-10)/7; $query = $sql->prepare("SELECT `id`,`cname`,`vname`,`name` FROM `userdata` WHERE `resellerid`=? AND `accounttype`='u' ORDER BY `id` DESC"); $query->execute(array($reseller_id)); @@ -479,4 +479,4 @@ if ($ui->w('action',4, 'post') and !token(true)) { configureDateTables('-1', '1, "asc"', 'ajax.php?w=datatable&d=tsdnsmasterserver'); $template_file = 'admin_voice_tsdns_list.tpl'; -} \ No newline at end of file +}