Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache error #58

Open
SSSV opened this issue Mar 18, 2015 · 0 comments
Open

Cache error #58

SSSV opened this issue Mar 18, 2015 · 0 comments
Labels
Milestone

Comments

@SSSV
Copy link

SSSV commented Mar 18, 2015

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.

  •  Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn' if not set.
    
  • @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 )
    return $url;
    $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$|_\'()\x80-\xff]|i', '', $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

    • presume it needs http:// appended (unless a relative
    • link starting with /, # or ? or a php file).
      */
      if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
      ! preg_match('/^[a-z0-9-]+?.php/i', $url) )
      $url = 'http://' . $url;
@wpsmith wpsmith modified the milestones: 1.2, 1.3 Apr 12, 2015
@wpsmith wpsmith added the bug label Apr 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants