Drupal 6 bootstrap error in bootstrap line 771 and 768
Posted by lhe | Posted in Content Management Systems, Drupal | Posted on 30-07-2009
7
While working on a Drupal site, we kept getting error messages after deleting content:
• recoverable fatal error: Object of class stdClass could not be
converted to string in /usr/local/drupal/includes/bootstrap.inc on line 768. • warning: preg_match() expects parameter 2 to be string, object given
in /usr/local/drupal/includes/bootstrap.inc on line 771.
after that we got a similar error but on line 735
we looked around for a bit and fixed it. we edited the bootstrap file, which is actually not done. if anyone found a better way to fix this issue, please comment on this post.
Anyway, this is what the bootstrap looks like now:
we changed lines 734 – 739:
function check_plain($text) {
if(!is_string($text)){
return "";
}
return drupal_validate_utf8($text) ? htmlspecialchars($text, ENT_QUOTES) : '';
}
and lines 770 – 775:
function drupal_validate_utf8($text) {
if (!is_string($text) || strlen($text) == 0) {
return TRUE;
}
return (preg_match('/^./us', $text) == 1);
}


