0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

phpcs reformat

This commit is contained in:
David Goodwin 2018-02-18 19:59:37 +00:00
parent 2dc502e684
commit cb34da4f46
3 changed files with 9 additions and 11 deletions

View File

@ -277,9 +277,9 @@ function check_email($email) {
return Config::lang_f('pInvalidMailRegex', $email);
}
if(function_exists('filter_var')) {
if (function_exists('filter_var')) {
$check = filter_var($email, FILTER_VALIDATE_EMAIL);
if(!$check) {
if (!$check) {
return Config::lang_f('pInvalidMailRegex', $email);
}
}
@ -309,7 +309,7 @@ function escape_string($string) {
// Note, the array keys are not cleaned.
if (is_array($string)) {
$clean = array();
foreach($string as $k => $v) {
foreach ($string as $k => $v) {
$clean[$k] = escape_string($v);
}
return $clean;
@ -1759,7 +1759,6 @@ function db_update_q($table, $where, $values, $timestamp = array('modified')) {
* Possible actions are defined in $LANG["pViewlog_action_$action"]
*/
function db_log($domain, $action, $data) {
if (!Config::bool('logging')) {
return true;
}
@ -1785,7 +1784,6 @@ function db_log($domain, $action, $data) {
} else {
return true;
}
}
/**
@ -1966,11 +1964,11 @@ function gen_show_status($show_alias) {
//make sure this alias goes somewhere known
$stat_ok = 1;
foreach($gotos as $g) {
if(!$stat_ok) {
foreach ($gotos as $g) {
if (!$stat_ok) {
break;
}
if(strpos($g, '@') === false) {
if (strpos($g, '@') === false) {
continue;
}

View File

@ -460,7 +460,7 @@ class AliasHandler extends PFAHandler {
} else {
$email_check = check_email($singlegoto);
// preg_match -> allows for redirect to a local system account.
if ($email_check != '' && !preg_match( '/^[a-z0-9]+$/', $singlegoto)) {
if ($email_check != '' && !preg_match('/^[a-z0-9]+$/', $singlegoto)) {
$errors[] = "$singlegoto: $email_check";
}
}

View File

@ -598,10 +598,10 @@ abstract class PFAHandler {
if (db_pgsql()) {
$formatted_date = "TO_CHAR(###KEY###, '" . escape_string(Config::Lang('dateformat_pgsql')) . "')";
# $base64_decode = "DECODE(###KEY###, 'base64')";
# $base64_decode = "DECODE(###KEY###, 'base64')";
} elseif (db_sqlite()) {
$formatted_date = "strftime(###KEY###, '" . escape_string(Config::Lang('dateformat_mysql')) . "')";
# $base64_decode = "base64_decode(###KEY###)";
# $base64_decode = "base64_decode(###KEY###)";
} else {
$formatted_date = "DATE_FORMAT(###KEY###, '" . escape_string(Config::Lang('dateformat_mysql')) . "')";
# $base64_decode = "FROM_BASE64(###KEY###)"; # requires MySQL >= 5.6