diff options
| author | spiderr <spiderr@bitweaver.org> | 2021-02-20 23:27:41 -0500 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2021-02-20 23:27:41 -0500 |
| commit | c2561b4d9b429a0ae85905f17c22b0e6453bf692 (patch) | |
| tree | a3d13c13cafbb1295c75974462ce98b6511a1d9d | |
| parent | 4ef6a0dbd81d1499101763db21c0897f1a27c2b3 (diff) | |
| parent | b7859686e8c8acf42186080cc3740caf4017b9ac (diff) | |
| download | liberty-c2561b4d9b429a0ae85905f17c22b0e6453bf692.tar.gz liberty-c2561b4d9b429a0ae85905f17c22b0e6453bf692.tar.bz2 liberty-c2561b4d9b429a0ae85905f17c22b0e6453bf692.zip | |
Merge branch 'master' of github.com:bitweaver/liberty
| -rw-r--r-- | includes/bit_setup_inc.php (renamed from bit_setup_inc.php) | 2 | ||||
| -rw-r--r-- | includes/comments_inc.php | 6 | ||||
| -rw-r--r-- | plugins/data.attachment.php | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/bit_setup_inc.php b/includes/bit_setup_inc.php index e7fc6d3..88238c7 100644 --- a/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -10,7 +10,7 @@ $registerHash = array( 'package_name' => 'liberty', - 'package_path' => dirname( __FILE__ ).'/', + 'package_path' => dirname( dirname( __FILE__ ) ).'/', 'required_package'=> TRUE, ); $gBitSystem->registerPackage( $registerHash ); 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; |
