Project

General

Profile

Actions

Bug #6175

closed

firewall_rules_edit possible php warning - floating rules when input error

Added by jeroen van breedam over 8 years ago. Updated over 8 years ago.

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

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.3
Affected Architecture:

Actions #2

Updated by Jim Pingle over 8 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.

Actions #3

Updated by jeroen van breedam over 8 years ago

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

Actions #4

Updated by Jim Thompson over 8 years ago

  • Assignee set to Anonymous
  • Target version set to 2.3.1
  • Affected Version set to 2.3
Actions #5

Updated by Jorge M. Oliveira over 8 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.

Actions #6

Updated by jeroen van breedam over 8 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?)

Actions #7

Updated by Anonymous over 8 years ago

  • Assignee changed from Anonymous 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.

Actions #8

Updated by jeroen van breedam over 8 years ago

seems fixed after gitsync. thanks all

Actions #9

Updated by Anonymous over 8 years ago

  • % Done changed from 0 to 100
Actions #10

Updated by Chris Buechler over 8 years ago

  • Status changed from Feedback to Resolved

fixed

Actions

Also available in: Atom PDF