warning: preg_match() expects parameter 2 to be string, array given in [mywebsite]/includes/bootstrap.inc on line 732
Getting this error with Drupal 6.5. Looks like LOTS of others are having “preg_match” issues, with MULTIPLE configs and modules. Different “lines” are reported (mine reports line 732) but mine is associated with the core “bootstrap.inc” file. I’ve tried enabling/disabling many of the modules others are reporting. I’ve run update.php multiple times. The error won’t go away. The website still LOADS and WORKS, but this message is highlighted in red at the top of all pages, except CiviCRM.
Running a “find differences” command indicates the bootstrap.inc file on the server and a fresh one on my local drive are identical, so I suspect it’s not corrupt. Should I perhaps still replace the existing bootstrap.inc file on the website with a clean Drupal 6.5 version of that particular file?
Help?

Having the same issue with
Having the same issue with the drupal 5.11 distribution. Its on line 679 for me.
Same message on my installation of 6.5
Same message on my installation of 6.5. Occurs in User page after updating profile.
Same error
Sorry I don't have any help for you just to add seeing the same error in the logs using 6.5 preg_match() expects parameter 2 to be string, array given in bootstrap.inc on line 732.
Must be Admin-Related
The preg_match error is present when logged in as User 1 or Admin.
The preg_match error is absent when logged in as Anonymous or Authenticated.
Any gurus care to take a stab in light of this additional info?
Quick fix
Ok, something is passing an array instead of a string to the function "check_plain" on line 696 of bootstrap.inc (drupal 6), which in turn calls the function drupal_validate_utf8 on line 732. I added the following quick fix right at the beginning of the function:
if (is_array($text)) return '';so that now it looks like this:
function check_plain($text) {if (is_array($text)) return ''; // <-- Modified!
return drupal_validate_utf8($text) ? htmlspecialchars($text, ENT_QUOTES) : '';
}
Asking for Trouble?
Thanks for the solution, g2010a. It brings up this issue: is this core-level tampering advisable? While it may fix this specific problem, is it likely to break something else?
I suspected this must have been an errant module. I have MANY installed. And, honestly, I suppose I have to be honest: I’m too damn lazy to turn them off one by one until the problem goes away. It already seems to take forever when I simply visit my modules page. I suppose I’ll need to do that little bit of troubeshooting if I’m to be a good Drupal neighbor.
But, could this alternatively actually be a core issue? The hack you propose ... is it something that perhaps SHOULD be in core but isn’t? I’d love for those scary red boxes with the error message to go away, but — not being a PHP geek — I fear risking other system instabilities with the core hack.
Thoughts?
It brings up this issue: is
Definitely not-- even if it doesn't break anything else, by modifying core you've essentially created a fork that you will need to maintain going forward. It's fine for a quick fix-- but definitely should be tracked down and fixed properly. I would turn off all contribs and see if it goes away-- if it does try the contribs 1 by 1 until you find the offender. If it doesn't, do the same with the optional core modules.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Has anyone else sourced a solution without patching core?
Has anyone else sourced a solution without patching core? Thanks.
Location/GMAP modules
If you are having the bootstrap 732 error and are running location/GMap modules, update to the newest rc release and you will hopefully be good to go.
Nope ...
I upgraded to the latest GMap module (rc2) and the error didn’t go away. I also turned it OFF. Error still there.
Drupal 6.6 preg_match() refers to line 737 instead of 732 now.
Just upgraded to Drupal 6.6. The preg_match() error has changed it’s tune. Now, instead of complaining about line 732, I get this error:
warning: preg_match() expects parameter 2 to be string, array given in [mywebsite]/includes/bootstrap.inc on line 737.
Same, is there an issue
Same, is there an issue about this?
Also the same
Same here also...
I have exactly the same issue
It happened today when I updated CCK, OG, Cumulus, and Facebook style statuses. I hope this will help pinpoint the problem.
Found the culprit - its Facebook Status
Hi everybody,
the last comment pinpointed the culprit in this case: it seems to come from the Facebook Status module. Deinstalling it and the error is gone. I added a bug report there: http://drupal.org/node/332411
That would be great, EXCEPT ...
I don’t have the Facebook Status module installed or activated. The search continues ...
Content copy issue
This error occurred for me to, using D5.16, when I activated the CCK "content copy" module. Error disappeared as soon as content copy was deactivated. So that's a possible cause which may help some people.
same same
Hi
I have the same error with :
* Drupal 6.13,
* MySQL 5.0.81
* PHP 5.2.8
"warning: preg_match() expects parameter 2 to be string, array given in /home/website/public_html/raya/includes/bootstrap.inc on line 771."
there an issue ?
S.
Same here also...
ERROR:
warning: preg_match() expects parameter 2 to be string, array given in /home/bingo/public_html/includes/bootstrap.inc on line 771.
Modules installed:
- Access control
- I have CCK - but not content copy enabled (so not that one for me at least)
- Image
- Ubercart
- Views
The message only shows up on checkout page. It disappears if all mods are turned off but the second I turn any two in combination with each other it reappears (it does not seem to be limited to any one mod)... and I have a few more mods to add yet!
Anyone?
Yah... here the same
warning: preg_match() expects parameter 2 to be string, array given in /home/website/public_html/includes/bootstrap.inc on line 771.
Drupal 6.12
PHP 5
don't know about MySQL
Trying to do multidomain and multilanguage: the supposed focus and strong point of Drupal...
We also get:
warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/website/public_html/sites/all/modules/l10n_client/l10n_client.module on line 307.
Maybe interesting to know, we DO NOT get either of the warnings on the DEFAULT LANGUAGE.
So it seems a problem of multilanguage! It has given a lot of headaches from the very start.
Also the markers assigned to specific terms seem to vary randomly between languages...
Does this give any clues?
link
Check the correct use of l() http://api.drupal.org/api/function/l/5.
Problem with Views 6.x-2.7
Just upgraded to Views 6.x.2-7 and this very same error now appears on a number of my pages which are built using views. My line number is reporting 777 but otherwise, exactly as you have described the problem.
Downgrading to Views 6.x.2.6 cleared my problem.
Error appeared for all users on my site.
Drupal 6.14
MySQL 5.1.33
PHP 5.2.9
I will cross post this issue on the Views project.
I'm having the same problem.
I'm having the same problem. How do you downgrade? Replace the new version on the server with the older version and then run Update.php? I guess I'd have to select something from the Versions Available drop-down, right? Any way to know which item to select?
Thanks,
~Dogtag
the same
Expiriencing the same problem (only difference is the line number, which is 777 in my case)... I guess it was just after I uninstalled the IMCE-Module and the associateded IMCE_Image-Field. It first appeared on the site of a content type, which used to have a IMCE-image-field, then it also appeared on a "panel-content"-page while creating a new panel-page.
???
What to do?? Any help much appreciated!!
All modules and core at the current stable releases..
Same Issue,
... but only while logged in as admin ...
any suggestions?
Same message with Menu Items List
Here is the message I receive on one of my sites:
warning: preg_match() expects parameter 2 to be string, array given in /home/etc../includes/bootstrap.inc on line 777.
For me, it only happens when I want to modify menu items.
visiting admin/build/menu works fine but then, when I click one of my menus (for example: "Primary Links") to manage the menu items, the message appears and the items are not listed.
An empty table is displayed, saying "Loading data..." and it doesn't load anything.
So, i don't just have the message...I can not make any change in my menus!
I have too many modules installed to list here. Unfortunately, I can not disable them one by one right now to find which one is causing the problem. I'll do it later, but in the mean time, if any one has a solution...
Thanks,
Thierry