Php Error - interfaces_gif_edit.php



  • 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



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

    if (($gif['if'] == $interface) && ($gif['tunnel-remote-addr'] == $_POST['tunnel-remote-addr'])) {
    


  • Fixed thx for reporting.



  • No Problem. Happy to help!.


Locked