Project

General

Profile

Bug #6175

firewall_rules_edit possible php warning - floating rules when input error

Added by jeroen van breedam about 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
Rules/NAT
Target version:
Start date:
04/15/2016
Due date:
% Done:

100%

Affected Version:
2.3
Affected Architecture:

Associated revisions

History

#2 Updated by Jim Pingle about 2 years ago

  • Category set to Rules/NAT
  • Status changed from New to Feedback
  • Assignee deleted (Jim Pingle)
  • Target version deleted (2.3.1)

See the thread. I can't reproduce it as-is. Needs more info before a ticket can be opened or a fix pursued, we have to be able to reproduce it to confirm it's fixed.

#3 Updated by jeroen van breedam about 2 years ago

i've just updated the thread after creating this ticket.

#4 Updated by Jim Thompson about 2 years ago

  • Assignee set to Steve Beaver
  • Target version set to 2.3.1
  • Affected Version set to 2.3

#5 Updated by Jorge M. Oliveira about 2 years ago

I wonder if this is as easy as

--- src/usr/local/www/firewall_rules_edit.php
+++ src/usr/local/www/firewall_rules_edit.php
@@ -194,7 +194,7 @@
     if (isset($a_filter[$id]['floating']) || $if == "FloatingRules") {
         $pconfig['floating'] = $a_filter[$id]['floating'];
         if (isset($a_filter[$id]['interface']) && $a_filter[$id]['interface'] <> "") {
-            $pconfig['interface'] = $a_filter[$id]['interface'];
+            $pconfig['interface'] = explode(",", $a_filter[$id]['interface']);
         }
     }

@@ -1205,7 +1205,7 @@
     $section->addInput($input = new Form_Select(
         'interface',
         'Interface',
-        explode(",", $pconfig['interface']),
+        $pconfig['interface'],
         build_if_list(),
         true
     ))->setHelp('Choose the interface(s) for this rule.');

This will place the explode() call in a more appropriate place and hopefully do the trick.

#6 Updated by jeroen van breedam about 2 years ago

Jorge M. Oliveira wrote:

I wonder if this is as easy as
[...]

This will place the explode() call in a more appropriate place and hopefully do the trick.

maybe, i'm not much of a coder & haven't tried your patch. i assume you have ;)
i put it below firewall_rules_edit.php#L441 because there $pconfig gets overwritten by $_post. (does $pconfig['interfaces'] survive?)

#7 Updated by Steve Beaver about 2 years ago

  • Assignee changed from Steve Beaver to jeroen van breedam

Change suggested by Jorge M. Oliveira was found to be effective and has been merged.

Thanks Jeroen and Jorge.

Since this issue is difficult to reproduce, please confirm that the fix was effective.

#8 Updated by jeroen van breedam about 2 years ago

seems fixed after gitsync. thanks all

#9 Updated by Steve Beaver about 2 years ago

  • % Done changed from 0 to 100

#10 Updated by Chris Buechler about 2 years ago

  • Status changed from Feedback to Resolved

fixed

Also available in: Atom PDF