Make WordPress Core

Changeset 13983


Ignore:
Timestamp:
04/04/2010 03:07:14 AM (15 years ago)
Author:
nacin
Message:

Cast subject of _deep_replace() to string to prevent an infinite loop. props mdawaffe, fixes #12386

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r13982 r13983  
    21832183 * @return string The processed string
    21842184 */
    2185 function _deep_replace($search, $subject){
     2185function _deep_replace( $search, $subject ) {
    21862186    $found = true;
    2187     while($found) {
     2187    $subject = (string) $subject;
     2188    while ( $found ) {
    21882189        $found = false;
    2189         foreach( (array) $search as $val ) {
    2190             while(strpos($subject, $val) !== false) {
     2190        foreach ( (array) $search as $val ) {
     2191            while ( strpos( $subject, $val ) !== false ) {
    21912192                $found = true;
    2192                 $subject = str_replace($val, '', $subject);
     2193                $subject = str_replace( $val, '', $subject );
    21932194            }
    21942195        }
Note: See TracChangeset for help on using the changeset viewer.