diff options
author | Simon Rettberg | 2022-05-02 18:49:09 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-05-02 18:49:09 +0200 |
commit | 5eb8df7432a708284862e4b126e418265d36b4ab (patch) | |
tree | d8812cc2bd6245e0b02ca6866a4c14e977e1bb62 /inc/paginate.inc.php | |
parent | [rebootcontrol] Show time of execution for WOL/reboot/shutdown (diff) | |
download | slx-admin-5eb8df7432a708284862e4b126e418265d36b4ab.tar.gz slx-admin-5eb8df7432a708284862e4b126e418265d36b4ab.tar.xz slx-admin-5eb8df7432a708284862e4b126e418265d36b4ab.zip |
[inc/Util] Add types, move error printing functions to their own class
Diffstat (limited to 'inc/paginate.inc.php')
-rw-r--r-- | inc/paginate.inc.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/inc/paginate.inc.php b/inc/paginate.inc.php index b212e252..3187261c 100644 --- a/inc/paginate.inc.php +++ b/inc/paginate.inc.php @@ -19,30 +19,30 @@ class Paginate $this->currentPage = (isset($_GET['page']) ? (int)$_GET['page'] : 0); $this->perPage = (int)$perPage; if ($this->currentPage < 0) { - Util::traceError('Current page < 0'); + ErrorHandler::traceError('Current page < 0'); } if ($this->perPage < 1) { - Util::traceError('Per page < 1'); + ErrorHandler::traceError('Per page < 1'); } // Query if (!preg_match('/\s*SELECT\s/is', $query)) { - Util::traceError('Query has to start with SELECT!'); + ErrorHandler::traceError('Query has to start with SELECT!'); } // XXX: MySQL only if (preg_match('/^mysql/i', CONFIG_SQL_DSN)) { // Sanity: Check for LIMIT specification at the end if (preg_match('/LIMIT\s+(\d+|\:\w+|\?)\s*,\s*(\d+|\:\w+|\?)(\s|;)*(\-\-.*)?$/is', $query)) { - Util::traceError("You cannot pass a query containing a LIMIT to the Paginator class!"); + ErrorHandler::traceError("You cannot pass a query containing a LIMIT to the Paginator class!"); } // Sanity: no comment or semi-colon at end (sloppy, might lead to false negatives) if (preg_match('/(\-\-|;)(\s|[^\'"`])*$/is', $query)) { - Util::traceError("Your query must not end in a comment or semi-colon!"); + ErrorHandler::traceError("Your query must not end in a comment or semi-colon!"); } // Don't use SQL_CALC_FOUND_ROWS as it leads to filesort frequently thus being slower than two queries // See https://www.percona.com/blog/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/ } else { - Util::traceError('Unsupported database engine'); + ErrorHandler::traceError('Unsupported database engine'); } // Mangle URL if ($url === false) $url = $_SERVER['REQUEST_URI']; |