diff options
author | Thomas Lange <code@nerdmind.de> | 2017-04-19 23:27:24 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2017-04-19 23:27:24 +0200 |
commit | 1ab7ed73b0ea9d1f8597cf9b87bf272a7e6b99e6 (patch) | |
tree | 45f480a8ed8267489ad62f12c486e7ab16c748ce /core | |
parent | 772f4ebd5d9b22fdfad044a42d4ab9f16cee925b (diff) | |
download | blog-1ab7ed73b0ea9d1f8597cf9b87bf272a7e6b99e6.tar.gz blog-1ab7ed73b0ea9d1f8597cf9b87bf272a7e6b99e6.tar.xz blog-1ab7ed73b0ea9d1f8597cf9b87bf272a7e6b99e6.zip |
Comments added and unnecessary "abs" function calls removed.
Diffstat (limited to 'core')
-rw-r--r-- | core/include/page/list.php | 5 | ||||
-rw-r--r-- | core/include/post/list.php | 5 | ||||
-rw-r--r-- | core/include/user/list.php | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/core/include/page/list.php b/core/include/page/list.php index 25409e5..f80c461 100644 --- a/core/include/page/list.php +++ b/core/include/page/list.php @@ -5,13 +5,16 @@ $Database = Application::getDatabase(); $Language = Application::getLanguage(); +#=============================================================================== +# Pagination +#=============================================================================== $site_size = Application::get('PAGE.LIST_SIZE'); $site_sort = Application::get('PAGE.LIST_SORT'); $lastSite = ceil($Database->query(sprintf('SELECT COUNT(id) FROM %s', Page\Attribute::TABLE))->fetchColumn() / $site_size); $currentSite = HTTP::GET('site') ?? 1; -$currentSite = abs(intval($currentSite)); +$currentSite = intval($currentSite); if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) { Application::error404(); diff --git a/core/include/post/list.php b/core/include/post/list.php index f2edd0b..4b8ea28 100644 --- a/core/include/post/list.php +++ b/core/include/post/list.php @@ -5,13 +5,16 @@ $Database = Application::getDatabase(); $Language = Application::getLanguage(); +#=============================================================================== +# Pagination +#=============================================================================== $site_size = Application::get('POST.LIST_SIZE'); $site_sort = Application::get('POST.LIST_SORT'); $lastSite = ceil($Database->query(sprintf('SELECT COUNT(id) FROM %s', Post\Attribute::TABLE))->fetchColumn() / $site_size); $currentSite = HTTP::GET('site') ?? 1; -$currentSite = abs(intval($currentSite)); +$currentSite = intval($currentSite); if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) { Application::error404(); diff --git a/core/include/user/list.php b/core/include/user/list.php index 692bba6..6009164 100644 --- a/core/include/user/list.php +++ b/core/include/user/list.php @@ -5,13 +5,16 @@ $Database = Application::getDatabase(); $Language = Application::getLanguage(); +#=============================================================================== +# Pagination +#=============================================================================== $site_size = Application::get('USER.LIST_SIZE'); $site_sort = Application::get('USER.LIST_SORT'); $lastSite = ceil($Database->query(sprintf('SELECT COUNT(id) FROM %s', User\Attribute::TABLE))->fetchColumn() / $site_size); $currentSite = HTTP::GET('site') ?? 1; -$currentSite = abs(intval($currentSite)); +$currentSite = intval($currentSite); if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) { Application::error404(); |