Skip to:
Content

BuddyPress.org

Ticket #6159: 6159.1.patch

File 6159.1.patch, 1.2 KB (added by DJPaul, 10 years ago)
  • src/bp-activity/bp-activity-functions.php

    diff --git a/src/bp-activity/bp-activity-functions.php b/src/bp-activity/bp-activity-functions.php
    index 1444c89..2d4100b 100644
    a b function bp_activity_thumbnail_content_images( $content, $link = false, $args = 
    26182618                preg_match( '/<img.*?(height\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $height );
    26192619                preg_match( '/<img.*?(width\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i',  $matches[0][0], $width  );
    26202620
    2621                 if ( !empty( $src ) ) {
    2622                         $src    = substr( substr( str_replace( 'src=',    '', $src[1]    ), 0, -1 ), 1 );
    2623                         $height = substr( substr( str_replace( 'height=', '', $height[1] ), 0, -1 ), 1 );
    2624                         $width  = substr( substr( str_replace( 'width=',  '', $width[1]  ), 0, -1 ), 1 );
     2621                if ( ! empty( $src ) ) {
     2622                        $src = substr( substr( str_replace( 'src=', '', $src[1] ), 0, -1 ), 1 );
     2623
     2624                        if ( isset( $width[1] ) ) {
     2625                                $width = substr( substr( str_replace( 'width=', '', $width[1] ), 0, -1 ), 1 );
     2626                        }
     2627
     2628                        if ( isset( $height[1] ) ) {
     2629                                $height = substr( substr( str_replace( 'height=', '', $height[1] ), 0, -1 ), 1 );
     2630                        }
    26252631
    26262632                        if ( empty( $width ) || empty( $height ) ) {
    26272633                                $width  = 100;