From that it looks like whatever is being passed in for $search is an array, and not a string as the function expects.
As for how to track that down, that’s probably a bit harder. I’d start off by doing the standard de-bigging process of deactivating all plugins and switching to the default theme. Then one-by-one re-enable each plugin and then the theme, and test in between each one to see if the problem still exists. That should tell you whcih plugin or your theme that’s causing the problem.
This seems to be a ‘standard’ issue in many WP installations – I also stumbled across it while trying to debug another issue: with debug output activated the error occurs many times. (running WPv3.9.1)
Two locations highlighted for me (in wp_includes/formatting.php):
line #448: function _wp_specialchars
line #583: function wp_check_invalid_utf8
… but could easily arise in several other instances.
To correct this, code needs to check for arrays being passed, and either reject them, or process them. I chose the latter, adding the following code to each immediately after the function declaration:
for _wp_specialchars:
if( is_array($string) ){
foreach($string as $k=>$sVal){
$string[$k] = _wp_specialchars( $sVal, $quote_style, $charset, $double_encode );
}
return $string;
}
for wp_check_invalid_utf8:
if( is_array($string) ){
foreach($string as $k=>$sVal){
$string[$k] = wp_check_invalid_utf8( $sVal, $strip );
}
return $string;
}
Don’t know if this is really fixing anything – but site appears to be working, and without these notices occurring.