Cast subject of _deep_replace() to string to prevent an infinite loop. props mdawaffe, fixes #12386
git-svn-id: http://svn.automattic.com/wordpress/trunk@13983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e4aabba998
commit
ecec297237
|
@ -2182,14 +2182,15 @@ function wp_htmledit_pre($output) {
|
|||
* @param string $subject
|
||||
* @return string The processed string
|
||||
*/
|
||||
function _deep_replace($search, $subject){
|
||||
function _deep_replace( $search, $subject ) {
|
||||
$found = true;
|
||||
while($found) {
|
||||
$subject = (string) $subject;
|
||||
while ( $found ) {
|
||||
$found = false;
|
||||
foreach( (array) $search as $val ) {
|
||||
while(strpos($subject, $val) !== false) {
|
||||
foreach ( (array) $search as $val ) {
|
||||
while ( strpos( $subject, $val ) !== false ) {
|
||||
$found = true;
|
||||
$subject = str_replace($val, '', $subject);
|
||||
$subject = str_replace( $val, '', $subject );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue