diff options
| author | spiderr <spiderr@bitweaver.org> | 2021-02-14 22:51:42 -0500 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2021-02-14 22:51:42 -0500 |
| commit | 16ffaf51374aef2c38b99c2ab1f97c3545643e7a (patch) | |
| tree | d5d72563cf9b64c20895e0d34ee3a54a5dae2611 | |
| parent | 9af28404f65f74b5d69cc0975c6c744c03361bf8 (diff) | |
| parent | b7859686e8c8acf42186080cc3740caf4017b9ac (diff) | |
| download | liberty-16ffaf51374aef2c38b99c2ab1f97c3545643e7a.tar.gz liberty-16ffaf51374aef2c38b99c2ab1f97c3545643e7a.tar.bz2 liberty-16ffaf51374aef2c38b99c2ab1f97c3545643e7a.zip | |
Merge branch 'master' of github.com:bitweaver/liberty
| -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; |
