• I’ve got this error using wp-phpbb bridge
    Catchable fatal error: Object of class WP_Error could not be converted to string in /var/www/name/data/www/site.ru/wp-includes/formatting.php on line 2822

    /**
     * Properly strip all HTML tags including script and style
     *
     * @since 2.9.0
     *
     * @param string $string String containing HTML tags
     * @param bool $remove_breaks optional Whether to remove left over line breaks and white space chars
     * @return string The processed string.
     */
    function wp_strip_all_tags($string, $remove_breaks = false) {
    2822-->	$string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
    	$string = strip_tags($string);
    
    	if ( $remove_breaks )
    		$string = preg_replace('/[\r\n\t ]+/', ' ', $string);
    
    	return trim($string);
    }

    WPMU 3.1.2 + BuddyPress 1.2.8 + phpBB 3.0.7

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter MAzZY

    (@mazzy)

    It’s good plugin but not solve this problem.
    Creating new user with turned off wp-phpbb bridge is OK. But with turned on I’ve got error. Where is the fault?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The fault is in the wp-phpbb bridge not sanitizing the users OR the fact that you set up phpBB in a way that’s incompatible with WordPress.

    I just posted a new blog and when I open my blog site the whole page doesn’t come up, but if you click on the blog title, it will. This is what I see on the page:

    (this is part of the blog I wrote – and there’s nothing else on the page but the following):

    “works together in Nature, and we would find answers, if we but looked to nature, observed her seasons, etc. etc…..even the angels are ‘tied’ into this ‘seasonal’ stuff; pretty amazing! Continue reading →

    → Leave a comment
    <a href=”
    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/sham8551/public_html/This/wp-content/themes/coraline/loop.php on line 68

    I deleted the blog post – and things seem to be working fine; can’t figure it out? Any suggestions. Thanks.

    Okay, so the same error is back again:

    <a href=”
    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/XXXXX/public_html/This/wp-content/themes/coraline/loop.php on line 68

    Could it be the template I am using is not compatible with WP 3.1.3?

    I had the same problem with usernames, but this function helped me

    function allow_cyrillic_username($username, $raw_username, $strict) {
    	$username = wp_strip_all_tags($raw_username);
    	$username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);
    	$username = preg_replace('/&.+?;/', '', $username);
    
    	if ( $strict )
    		$username = preg_replace('|[^a-zа-я0-9 _.\-@]|iu', '', $username);
    
    	return preg_replace('|\s+|', ' ', $username);
    }
    add_filter('sanitize_user', 'allow_cyrillic_username', 10, 3);

    or try this plugin ( haven’t tried )
    https://www.ads-software.com/extend/plugins/wordpress-special-characters-in-usernames/

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Catchable fatal error: Object of class WP_Error could not be converted to string’ is closed to new replies.