diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2021-09-02 19:20:50 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2021-09-02 19:20:50 +0300 |
commit | 8f2f3eff405c1d724ad502ed3bdcb0a5cef72671 (patch) | |
tree | a2b07578a6b302ffbd9b8d4505aa44211369a2fc /libraries/classes/Footer.php | |
parent | 5725516656e8d537adab523cfe5db3baf2057921 (diff) |
Remove the `Core::isValid` method
This improves the type checking and simplifies the code.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'libraries/classes/Footer.php')
-rw-r--r-- | libraries/classes/Footer.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libraries/classes/Footer.php b/libraries/classes/Footer.php index 3d708e8882..6481412395 100644 --- a/libraries/classes/Footer.php +++ b/libraries/classes/Footer.php @@ -14,6 +14,7 @@ use function file_exists; use function in_array; use function is_array; use function is_object; +use function is_scalar; use function json_encode; use function json_last_error; use function strlen; @@ -229,7 +230,11 @@ class Footer global $dbi; if ( - Core::isValid($_REQUEST['no_history']) + ( + isset($_REQUEST['no_history']) + && is_scalar($_REQUEST['no_history']) + && strlen((string) $_REQUEST['no_history']) > 0 + ) || ! empty($GLOBALS['error_message']) || empty($GLOBALS['sql_query']) || ! isset($dbi) @@ -239,8 +244,8 @@ class Footer } $this->relation->setHistory( - Core::isValid($GLOBALS['db'], 'similar', '') ? $GLOBALS['db'] : '', - Core::isValid($GLOBALS['table'], 'similar', '') ? $GLOBALS['table'] : '', + isset($GLOBALS['db']) && is_scalar($GLOBALS['db']) ? (string) $GLOBALS['db'] : '', + isset($GLOBALS['table']) && is_scalar($GLOBALS['table']) ? (string) $GLOBALS['table'] : '', $GLOBALS['cfg']['Server']['user'], $GLOBALS['sql_query'] ); |