Make WordPress Core

Ticket #23888: 23888.3.diff

File 23888.3.diff, 1.1 KB (added by SergeyBiryukov, 12 years ago)
  • wp-includes/media.php

     
    20692069                }
    20702070        }
    20712071
    2072         // these functions expected a reference, not a value
    2073         $_content = $post->post_content;
    2074         $content =& $_content;
     2072        // these functions expect a reference, so we should make a copy of post content to avoid changing it
     2073        $content = $post->post_content;
    20752074
    20762075        $htmls = get_content_media( $type, $content, true, true );
    20772076        if ( ! empty( $htmls ) ) {
     
    23862385
    23872386                $count = 1;
    23882387                $matches = array();
    2389                 $content =& $post->post_content;
     2388                $content = $post->post_content;
    23902389
    23912390                if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) {
    23922391                        foreach ( $matches as $shortcode ) {
     
    24152414                return $post->format_content;
    24162415        }
    24172416
    2418         $content =& $post->post_content;
     2417        $content = $post->post_content;
    24192418        $htmls = get_content_images( $content, true, true, 1 );
    24202419        if ( ! empty( $htmls ) ) {
    24212420                $html = reset( $htmls );