diff options
| author | spiderr <spiderr@bitweaver.org> | 2021-02-14 22:24:11 -0500 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2021-02-14 22:24:11 -0500 |
| commit | b7859686e8c8acf42186080cc3740caf4017b9ac (patch) | |
| tree | d5d72563cf9b64c20895e0d34ee3a54a5dae2611 /plugins | |
| parent | 116137f6e730f1d061c1f47eb41266cae0ee30b4 (diff) | |
| download | liberty-b7859686e8c8acf42186080cc3740caf4017b9ac.tar.gz liberty-b7859686e8c8acf42186080cc3740caf4017b9ac.tar.bz2 liberty-b7859686e8c8acf42186080cc3740caf4017b9ac.zip | |
check pObject on data_attachment
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/data.attachment.php | 4 |
1 files changed, 2 insertions, 2 deletions
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; |
