-
Wordpress 2.8.1 Error – Call to undefined function: _deep_replace()
Posted on July 18th, 2009 No commentsProblem:
When trying to login to the admin section of word press http://www.yoursite.com/wp-admin the following error message appears
Fatal error: Call to undefined function: _deep_replace() in /home/yoursiterooddir/yoursitename.com/wp-includes/pluggable.php on line 884
If you are in fact able to see the login screen and try to login, the above message will appear. If you go back to the wp-admin page directly the dashboard appears. If you try to execute any changes, the message will appear again.
Analysis:
I compared the wp-includes/pluggable.php code on or around line 884 to the code in version 2.8.0. See differences below:
version 2.8.1 of wp-includes/pluggable.php
// remove %0d and %0a from location $strip = array('%0d', '%0a', '%0D', '%0A'); $location = _deep_replace($strip, $location); return $location; } endif;version 2.8.0 of wp-includes/pluggable.php
// remove %0d and %0a from location $strip = array('%0d', '%0a'); $found = true; while($found) { $found = false; foreach( (array) $strip as $val ) { while(strpos($location, $val) !== false) { $found = true; $location = str_replace($val, '', $location); } } } return $location; } endif;Solution:
Comment out 2.8.1 code, then copy and paste 2.8.0 code below it. You can also just copy and past code provided below. Upload to your site and all should be ok until WP releases an update to correct this issue.
// remove %0d and %0a from location /*$strip = array('%0d', '%0a', '%0D', '%0A'); $location = _deep_replace($strip, $location); return $location; } endif;*/// JSTomasi :: CODE from previous version 2.8.0 // remove %0d and %0a from location $strip = array('%0d', '%0a'); $found = true; while($found) { $found = false; foreach( (array) $strip as $val ) { while(strpos($location, $val) !== false) { $found = true; $location = str_replace($val, '', $location); } } } return $location; } endif;Leave a reply


