You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I deleted a few empty categories and I'm suddenly seeing this error on my site:
Catchable fatal error: Object of class WP_Error could not be converted to string in /home/content/l/i/s/lisaholley/html/redesign/wp-includes/formatting.php on line 3042
The following is the code on line 3042 in formatting.php: $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$|*\'()\x80-\xff]|i', '', $url);
I've had to completely deactivate the plugin to resurrect the site below that widget. Any ideas? This isn't something I'm familiar with. Thanks!
Full code:
/**
Checks and cleans a URL.
*
A number of characters are removed from the URL. If the URL is for displaying
(the default behaviour) ampersands are also replaced. The 'clean_url' filter
I deleted a few empty categories and I'm suddenly seeing this error on my site:
Catchable fatal error: Object of class WP_Error could not be converted to string in /home/content/l/i/s/lisaholley/html/redesign/wp-includes/formatting.php on line 3042
The following is the code on line 3042 in formatting.php:
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$ |*\'()\x80-\xff]|i', '', $url);
I've had to completely deactivate the plugin to resurrect the site below that widget. Any ideas? This isn't something I'm familiar with. Thanks!
Full code:
/**
Checks and cleans a URL.
*
A number of characters are removed from the URL. If the URL is for displaying
(the default behaviour) ampersands are also replaced. The 'clean_url' filter
is applied to the returned cleaned URL.
*
@SInCE 2.8.0
*
@param string $url The URL to be cleaned.
@param array $protocols Optional. An array of acceptable protocols.
@param string $_context Private. Use esc_url_raw() for database usage.
@return string The cleaned $url after the 'clean_url' filter is applied.
*/
function esc_url( $url, $protocols = null, $_context = 'display' ) {
$original_url = $url;
if ( '' == $url )
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$ |_\'()\x80-\xff]|i', '', $url);
return $url;
$strip = array('%0d', '%0a', '%0D', '%0A');
$url = deep_replace($strip, $url);
$url = str_replace(';//', '://', $url);
/ If the URL doesn't appear to contain a scheme, we
*/
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
! preg_match('/^[a-z0-9-]+?.php/i', $url) )
$url = 'http://' . $url;
The text was updated successfully, but these errors were encountered: