diff options
Diffstat (limited to 'liberty_plugins/data.image.php')
| -rw-r--r-- | liberty_plugins/data.image.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/liberty_plugins/data.image.php b/liberty_plugins/data.image.php index 59184ea..d421158 100644 --- a/liberty_plugins/data.image.php +++ b/liberty_plugins/data.image.php @@ -100,7 +100,11 @@ function data_image( $pData, $pParams ) { // if this image is linking to something, wrap the image with the <a> $ret = '<a href="'.trim( $wrapper['link'] ).'">'.$ret.'</a>'; } elseif ( empty( $pParams['size'] ) || $pParams['size'] != 'original' ) { - $ret = '<a href="'.trim( $item->mInfo['source_url'] ).'">'.$ret.'</a>'; + if ( !empty( $item->mInfo['source_url'] ) ) { + $ret = '<a href="'.trim( $item->mInfo['source_url'] ).'">'.$ret.'</a>'; + } else if ( !empty( $item->mInfo['media_url'] ) ) { + $ret = '<a href="'.trim( $item->mInfo['media_url'] ).'">'.$ret.'</a>'; + } } if( !empty( $wrapper['style'] ) || !empty( $class ) || !empty( $wrapper['description'] ) ) { |
