Make WordPress Core

Changeset 31416


Ignore:
Timestamp:
02/11/2015 07:14:09 PM (10 years ago)
Author:
wonderboymusic
Message:

After [31415], make sure str_replace() only occurs once for each matched tag to avoid overwriting until <pre>s.

See #31214.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-oembed.php

    r31415 r31416  
    569569            $token = '__PRE__';
    570570            $replace = array();
     571            $count = 1;
     572
    571573            $dom = new DOMDocument();
    572574            $dom->loadHTML( $html );
     
    576578                $tag_token = $token . $i;
    577579                $replace[ $tag_token ] = $tag_html;
    578                 $html = str_replace( $tag_html, $tag_token, $html );
     580
     581                $html = str_replace( $tag_html, $tag_token, $html, $count );
    579582            }
    580583            $pre = array_values( $replace );
Note: See TracChangeset for help on using the changeset viewer.