• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Php Error - interfaces_gif_edit.php

2.1 Snapshot Feedback and Problems - RETIRED
3
4
1.2k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    gjdunga
    last edited by Jan 26, 2013, 10:42 PM

    Parse error: syntax error, unexpected '{' in /usr/local/www/interfaces_gif_edit.php on line 94

    While using :
    2.1-BETA1 (i386)
    built on Sat Jan 26 10:18:38 EST 2013
    FreeBSD 8.3-RELEASE-p5

    Code Snippet:

    
    68: if ($_POST) {
    69:
    70:        unset($input_errors);
    71:        $pconfig = $_POST;
    72:
    73:       /* input validation */
    74:        $reqdfields = explode(" ", "if tunnel-remote-addr tunnel-remote-net tunnel-local-addr");
    75:        $reqdfieldsn = array(gettext("Parent interface,Local address, Remote tunnel address, Remote tunnel network, Local tunnel address"));
    76:
    77:        do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
    78:
    79:       if ((!is_ipaddr($_POST['tunnel-local-addr'])) || (!is_ipaddr($_POST['tunnel-remote-addr'])) ||
    80:                        (!is_ipaddr($_POST['remote-addr']))) {
    81:                $input_errors[] = gettext("The tunnel local and tunnel remote fields must have valid IP addresses.");
    82:        }
    83:
    84:        $alias = strstr($_POST['if'],'|');
    85:        if ((is_ipaddrv4($alias) && !is_ipaddrv4($_POST['remote-addr'])) ||
    86:                        (is_ipaddrv6($alias) && !is_ipaddrv6($_POST['remote-addr'])))
    87:                $input_errors[] = gettext("The alias IP address family has to match the family of the remote peer address.");
    88:
    89:        foreach ($a_gifs as $gif) {
    90:                if (isset($id) && ($a_gifs[$id]) && ($a_gifs[$id] === $gif))
    91:                        continue;
    92:
    93:                /* FIXME: needs to perform proper subnet checks in the feature */
    94:                if (($gif['if'] == $interface && ($gif['tunnel-remote-addr'] == $_POST['tunnel-remote-addr'])) {
    95:                        $input_errors[] = sprintf(gettext("A gif with the network %s is already defined."), $gif['tunnel-remote-addr']);
    96:                        break;
    97:                }
    98:        }
    
    

    Does the line need a ; ??

    Gabriel

    1 Reply Last reply Reply Quote 0
    • B
      bardelot
      last edited by Jan 27, 2013, 1:35 AM

      No, the parenthesis are unbalanced. This is what it should be:

      if (($gif['if'] == $interface) && ($gif['tunnel-remote-addr'] == $_POST['tunnel-remote-addr'])) {
      
      1 Reply Last reply Reply Quote 0
      • E
        eri--
        last edited by Jan 27, 2013, 9:39 AM

        Fixed thx for reporting.

        1 Reply Last reply Reply Quote 0
        • G
          gjdunga
          last edited by Jan 27, 2013, 4:56 PM

          No Problem. Happy to help!.

          1 Reply Last reply Reply Quote 0
          4 out of 4
          • First post
            4/4
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.