diff options
| -rw-r--r-- | includes/comments_inc.php | 6 | ||||
| -rw-r--r-- | plugins/data.attachment.php | 4 |
2 files changed, 6 insertions, 4 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; } diff --git a/plugins/data.attachment.php b/plugins/data.attachment.php index f607eb4..aba0dd5 100644 --- a/plugins/data.attachment.php +++ b/plugins/data.attachment.php @@ -122,7 +122,7 @@ function data_attachment( $pData, $pParams, $pCommonObject, $pParseHash ) { $att = array(); - if( is_a( $pCommonObject, 'LibertyMime' ) && !($att = $pCommonObject->getAttachment( $pParams['id'], $pParams )) ) { + if( empty( $pCommonObject ) || !is_a( $pCommonObject, 'LibertyMime' ) && !($att = $pCommonObject->getAttachment( $pParams['id'], $pParams )) ) { $ret = tra( "The attachment id given is not valid." ); return $ret; } @@ -193,7 +193,7 @@ function data_attachment( $pData, $pParams, $pCommonObject, $pParseHash ) { $height = !empty( $pParams['height'] ) ? $pParams['height'] : ''; $gBitSmarty->assign( 'height', $height ); - +eb( $att ); $mimehandler = (( !empty( $wrapper['output'] ) && $wrapper['output'] == 'thumbnail' ) ? LIBERTY_DEFAULT_MIME_HANDLER : $att['attachment_plugin_guid'] ); $ret = $gBitSmarty->fetch( $gLibertySystem->getMimeTemplate( 'attachment', $mimehandler )); return $ret; |
