From 04a893de744d23f3c4e28ee3f1d1a1ca34c2cfc7 Mon Sep 17 00:00:00 2001 From: xbipin Date: Wed, 28 Jan 2015 13:26:54 +0400 Subject: [PATCH] multiple allow/deny entries for UPnP (rowhelper) with this additional change we can allow infinite number of entries rather than just 500 due to the for loop set to a max of 500 because the rowhelper control doesnt post as an array but just adds a number at the end of the variable and we try and modify the pkg_edit.php file then it would affect other packages --- usr/local/pkg/miniupnpd.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc index c48e767860..34fab47841 100644 --- a/usr/local/pkg/miniupnpd.inc +++ b/usr/local/pkg/miniupnpd.inc @@ -98,7 +98,8 @@ $input_errors[] = 'You must specify a valid traffic shaping queue.'; /* user permissions validation */ - for ($i=0; $i<500; $i++){ + $j = substr_count(implode(array_keys($post)), "permuser"); + for ($i=0; $i<$j; $i++){ if($post["permuser{$i}"]) { $perm = explode(' ',$post["permuser{$i}"]); /* should explode to 4 args */