Skip to content

Commit

Permalink
HAProxy: replace !== with !empty(). Fixes #12692
Browse files Browse the repository at this point in the history
  • Loading branch information
vktg committed Jan 18, 2022
1 parent 650a032 commit 0ef4453
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion net/pfSense-pkg-haproxy-devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PORTNAME= pfSense-pkg-haproxy-devel
PORTVERSION= 0.62
PORTREVISION= 7
PORTREVISION= 8
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ function is_port_or_alias($port) {
}
}

if ($_POST['client_timeout'] !== "" && !is_numeric($_POST['client_timeout'])) {
if (!empty($_POST['client_timeout']) && !is_numeric($_POST['client_timeout'])) {
$input_errors[] = sprintf(gettext("The value '%s' in field 'Client timeout' is not a number."), htmlspecialchars($_POST['client_timeout']));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,16 @@ function fields_actions_details_showfieldfunction($htmltable, $itemname, $values
if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['name'])) {
$input_errors[] = "The field 'Name' contains invalid characters.";
}
if ($_POST['checkinter'] !== "" && !is_numeric($_POST['checkinter'])) {
if (!empty($_POST['checkinter']) && !is_numeric($_POST['checkinter'])) {
$input_errors[] = "The field 'Check frequency' value is not a number.";
}
if ($_POST['connection_timeout'] !== "" && !is_numeric($_POST['connection_timeout'])) {
if (!empty($_POST['connection_timeout']) && !is_numeric($_POST['connection_timeout'])) {
$input_errors[] = "The field 'Connection timeout' value is not a number.";
}
if ($_POST['server_timeout'] !== "" && !is_numeric($_POST['server_timeout'])) {
if (!empty($_POST['server_timeout']) && !is_numeric($_POST['server_timeout'])) {
$input_errors[] = "The field 'Server timeout' value is not a number.";
}
if ($_POST['retries'] !== "" && !is_numeric($_POST['retries'])) {
if (!empty($_POST['retries']) && !is_numeric($_POST['retries'])) {
$input_errors[] = "The field 'Retries' value is not a number.";
}
// the colon ":" is invalid in the username, other than that pretty much any character can be used.
Expand Down Expand Up @@ -453,7 +453,7 @@ function fields_actions_details_showfieldfunction($htmltable, $itemname, $values

$a_errorfiles = $errorfileslist->haproxy_htmllist_get_values();

if ($_POST['strict_transport_security'] !== "" && !is_numeric($_POST['strict_transport_security'])) {
if (!empty($_POST['strict_transport_security']) && !is_numeric($_POST['strict_transport_security'])) {
$input_errors[] = "The field 'Strict-Transport-Security' is not empty or a number.";
}

Expand Down

0 comments on commit 0ef4453

Please sign in to comment.