From cb34da4f461d1e470bee4564520cab649bfb4a4b Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sun, 18 Feb 2018 19:59:37 +0000 Subject: [PATCH] phpcs reformat --- functions.inc.php | 14 ++++++-------- model/AliasHandler.php | 2 +- model/PFAHandler.php | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 325c62ef..605dc72c 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -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; } diff --git a/model/AliasHandler.php b/model/AliasHandler.php index cff9b433..a7664dcc 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -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"; } } diff --git a/model/PFAHandler.php b/model/PFAHandler.php index 13ca99b5..106a609d 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -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