Ah the dreaded preg_match warning rears its ugly head yet again.

OS: Linux Ubuntu Hardy
PHP: 5.2.4-2ubuntu5.10
Drupal: 6.15

After upgrading from version 6.13 to 6.15 I began to see "warning: preg_match() expects parameter 2 to be string..." A little XDebugging around and it seems that the profile module is the culprit.

I have a field of type selection in the user profiles with several options. Whatever option is selected is being passed as an array into check_plain(), which of course fails because an array isn't very plain.

I'm attaching a patch which corrects the profile module to check the selected option in check_plain() instead of checking the selected option as an array. I would appreciate feedback if this was an appropriate fix.

CommentFileSizeAuthor
profile-fix-checkplain-select-options.patch857 bytesAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.