diff options
| author | spiderr <spiderr@bitweaver.org> | 2021-02-14 17:52:51 -0500 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2021-02-14 17:52:51 -0500 |
| commit | 116137f6e730f1d061c1f47eb41266cae0ee30b4 (patch) | |
| tree | e5a3e3ea707321bd21663366801b12a55e135236 | |
| parent | 6405d64233f5508bde52d0288ed70dbb8d616ae6 (diff) | |
| download | liberty-116137f6e730f1d061c1f47eb41266cae0ee30b4.tar.gz liberty-116137f6e730f1d061c1f47eb41266cae0ee30b4.tar.bz2 liberty-116137f6e730f1d061c1f47eb41266cae0ee30b4.zip | |
clean up comment_page value checking
| -rw-r--r-- | includes/comments_inc.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/comments_inc.php b/includes/comments_inc.php index b891d80..196a15d 100644 --- a/includes/comments_inc.php +++ b/includes/comments_inc.php @@ -250,16 +250,18 @@ if( $gContent->hasUserPermission( 'p_liberty_read_comments' )) { $_SESSION['liberty_comments_display_mode'] = $comments_display_style; } + $currentPage = BitBase::verifyIdParameter( $_REQUEST, 'comment_page', 1 ); + if( !empty( $_REQUEST['comment_page'] ) || !empty( $_REQUEST['post_comment_request'] ) ) { $comments_at_top_of_page = 'y'; } - $commentOffset = !empty( $_REQUEST['comment_page'] ) ? ($_REQUEST['comment_page'] - 1) * $maxComments : 0; + $commentOffset = ($currentPage - 1) * $maxComments; if( empty( $gComment )) { $gComment = new LibertyComment(); } - $currentPage = !empty( $_REQUEST['comment_page'] ) ? $_REQUEST['comment_page'] : 1; + $currentPage = BitBase::verifyIdParameter( $_REQUEST, 'comment_page', 1 ); if( $currentPage < 1 ) { $currentPage = 1; } |
