diff options
-rw-r--r-- | admin/page/index.php | 5 | ||||
-rw-r--r-- | admin/post/index.php | 5 | ||||
-rw-r--r-- | admin/user/index.php | 5 | ||||
-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 |
6 files changed, 24 insertions, 6 deletions
diff --git a/admin/page/index.php b/admin/page/index.php index 1405ff4..eeedbc1 100644 --- a/admin/page/index.php +++ b/admin/page/index.php @@ -10,13 +10,16 @@ define('AUTHENTICATION', TRUE); #=============================================================================== require '../../core/application.php'; +#=============================================================================== +# 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/admin/post/index.php b/admin/post/index.php index 54ddd6c..5130612 100644 --- a/admin/post/index.php +++ b/admin/post/index.php @@ -10,13 +10,16 @@ define('AUTHENTICATION', TRUE); #=============================================================================== require '../../core/application.php'; +#=============================================================================== +# 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/admin/user/index.php b/admin/user/index.php index 8631ac9..ca4dcab 100644 --- a/admin/user/index.php +++ b/admin/user/index.php @@ -10,13 +10,16 @@ define('AUTHENTICATION', TRUE); #=============================================================================== require '../../core/application.php'; +#=============================================================================== +# 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', 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(); 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(); |