From 8af5e4da013ec49e6f6178ebdaeb164d2dcc8f59 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 29 Dec 2017 10:59:06 +0100 Subject: [PATCH] Firewall/Nat, rule logic. better to force spacing in ruleToText() to prevent different pf command's from sticking together. for https://github.com/opnsense/core/issues/1326 --- src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php b/src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php index ebaf2720d..eeedb407a 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php +++ b/src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php @@ -199,7 +199,9 @@ abstract class Rule array_shift($tmp); $args = array_merge($args, $tmp); } - $ruleTxt .= call_user_func_array(array($this,$method), $args); + $cmdout = trim(call_user_func_array(array($this,$method), $args)); + $ruleTxt .= !empty($cmdout) && !empty($ruleTxt) ? " " : ""; + $ruleTxt .= $cmdout; } return $ruleTxt; }