• I get this message:

    Warning: preg_replace(): Compilation failed: nothing to repeat at offset 191 in /home/xxxxx/public_html/wp-content/themes/raindrops/functions.php on line 8712

    At the top of this single post:

    https://www.sagaciousnewsnetwork.com/the-secret-for-undetectable-mind-control/

    I noticed this error since the last theme update. I have not added any new plugins or changed code in child functions.php and are up to date on WP and Raindrops Theme.

    Help fixing is appreciated. Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter saga1984

    (@saga1984)

    It had NOTHING to with the theme! Sorry for the bother. It was some code inside the single post. The admin should probably delete this thread. Thanks.

    Thread Starter saga1984

    (@saga1984)

    The error is back! It disappeared on the above single post but now has reappeared on this single post:

    https://www.sagaciousnewsnetwork.com/california-politicians-could-soon-be-forced-to-wear-logos-of-top-corporate-donors/

    Perhaps it is the theme? Do you have any suggestions on what the problem might be and how to fix it? Thank you.

    Thread Starter saga1984

    (@saga1984)

    The error disappears when removing the hyperlink in the first 12-20 characters or so in the post. When I add the hyperlink back I get this message at top of post:

    Warning: preg_replace(): Compilation failed: nothing to repeat at offset 101 in /home4/xxxxxxx/public_html/wp-content/themes/raindrops/functions.php on line 8712

    AND the hyperlink is missing when error message appears.

    The error changed from:

    Warning: preg_replace(): Compilation failed: nothing to repeat at offset 191 in /home/xxxxx/public_html/wp-content/themes/raindrops/functions.php on line 8712

    to

    Warning: preg_replace(): Compilation failed: nothing to repeat at offset 101 in /home4/xxxxxxx/public_html/wp-content/themes/raindrops/functions.php on line 8712

    very strange…

    Theme Author nobita

    (@nobita)

    Please Add PHP Code child theme / functions.php

    <?php
    
    	function raindrops_link_url_text_decode( $matches ) {
    
    		if( isset( $matches[1] ) && preg_match('!%!', $matches[1] ) ) {
    
    			$replace = urldecode( $matches[1] );
    			$replace = esc_html( $replace );
    
    			return preg_replace("|(>.*)?". $matches[1]."*?</a>|", "$1{$replace}$2", $matches[0] );
    		}
    		return $matches;
    	}
    ?>

    Thank you.

    Theme Author nobita

    (@nobita)

    Bug fixed

    Sorry

    function raindrops_link_url_text_decode( $matches ) {
    
    		if( isset( $matches[1] ) &&  false !== strpos($matches[1], '%') ) {
    
    			$replace = urldecode( $matches[1] );
    			$replace = esc_html( $replace );
    
    			return preg_replace("|>". $matches[1]."</a>|", ">{$replace}</a>", $matches[0] );
    		}
    		return $matches[0];
    	}

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘error in functions.php’ is closed to new replies.