0

Since I moved the website to another server I'm getting this error on the frontend where that categories are:

Warning: preg_match() expects parameter 2 to be string, object given in /public/sites/www.siteurl.nl/wp-includes/formatting.php on line 1529

Warning: strip_tags() expects parameter 1 to be string, object given in /public/sites/www.siteurl.nl/wp-includes/formatting.php on line 1981

Code on line 1529:

if ( !preg_match('/[\x80-\xff]/', $string) )

Code on line 1981:

$title = strip_tags($title);

What is this error and how can this be solved?

Update:

This is the frontend:

enter image description here

It's showing categories from the jobs that are on the site. Which I can select on the backend side:

enter image description here

Regards, Robert

n00bly
  • 395
  • 6
  • 21
  • See if this helps: https://wordpress.stackexchange.com/questions/84061/php-warning-preg-match-expects-php-warning-strip-tags – Nikhil Dec 08 '17 at 08:32
  • You need to show us how are $title and $string initialized. The warning means what it says, the code considers the variables objects instead of strings, so I would like to see what is put there. – Michał Skrzypek Dec 08 '17 at 08:32
  • Show the value of `$string` and `$title`... – Yash Parekh Dec 08 '17 at 08:38
  • What's inside $string and $strip_tags? – Zyigh Dec 08 '17 at 08:42
  • First of all, this is not the error that triggers from WordPress Core. These two methods are used inside sanitize_title_with_dashes() and remove_accents() methods. Which means in theme/plugin you are passing an object instead of a string. – Nikhil Dec 08 '17 at 08:47
  • I've moved the website back to the old server and the error is gone... – n00bly Dec 08 '17 at 14:20

0 Answers0