From aa685f7a6d8a724ffe78bd2b4397714c7faff8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20LU=C3=87I?= Date: Mon, 12 Jan 2015 10:38:17 +0100 Subject: [PATCH] Ticket #3932 Use array_map to get more parallelism when there are many entries. This makes it not reach the execution timeout with large entries. --- etc/inc/captiveportal.inc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 710788be8f..3964b4010f 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -1028,13 +1028,9 @@ function captiveportal_passthrumac_configure($lock = false) { $rules = ""; if (is_array($config['captiveportal'][$cpzone]['passthrumac'])) { - $nentries = count($config['captiveportal'][$cpzone]['passthrumac']); - foreach ($config['captiveportal'][$cpzone]['passthrumac'] as $macent) { - if ($nentries > 100) - $rules .= captiveportal_passthrumac_configure_entry($macent, true); - else - $rules .= captiveportal_passthrumac_configure_entry($macent); - } + $tmprules = array_map('captiveportal_passthrumac_configure_entry', $config['captiveportal'][$cpzone]['passthrumac']); + $rules = implode("\n", $tmprules); + unset($tmprules); } return $rules;