The invitations shown on this page haven't been accepted yet. The status deleted means the user account has been terminated.

warning: preg_match() expects parameter 2 to be string, array given in /hsphere/local/home/jessia/starpals.org/includes/bootstrap.inc on line 723.
warning: preg_match() expects parameter 2 to be string, array given in /hsphere/local/home/jessia/starpals.org/includes/bootstrap.inc on line 723.
warning: preg_match() expects parameter 2 to be string, array given in /hsphere/local/home/jessia/starpals.org/includes/bootstrap.inc on line 723.
warning: preg_match() expects parameter 2 to be string, array given in /hsphere/local/home/jessia/starpals.org/includes/bootstrap.inc on line 723.
warning: preg_match() expects parameter 2 to be string, array given in /hsphere/local/home/jessia/starpals.org/includes/bootstrap.inc on line 723.
warning: preg_match() expects parameter 2 to be string, array given in /hsphere/local/home/jessia/starpals.org/includes/bootstrap.inc on line 723.
warning: preg_match() expects parameter 2 to be string, array given in /hsphere/local/home/jessia/starpals.org/includes/bootstrap.inc on line 723.
warning: preg_match() expects parameter 2 to be string, array given in /hsphere/local/home/jessia/starpals.org/includes/bootstrap.inc on line 723.

9 invitations have been successfully sent. You will be notified when any invitee joins the site.

The invites appear to have gone through, but I got this warning on the confirmation page. I don't actually know what this warning means, but I thought I should submit it.

Comments

mac_perlinski’s picture

Assigned: Unassigned » mac_perlinski
Status: Active » Needs review
StatusFileSize
new684 bytes

Ok there this patch needs review, I just checked php backtrace which showed that preg_match problem is due to check_plain function in invite_token.inc.
I'm attaching patch but this code needs review as i haven't had time to check all possible outcomes of this fix.
Maybe we should check plain somewhere else?
Note problem only exists when we have 2 or more email addresses in $form['email'] element for one email it works perfect.

Anyway looking forward some feedback from you guys when you review it.
-
Mac
maciej.perlinski@meant4.com

mdowsett’s picture

I'm having a similar error being reported:

warning: preg_match() expects parameter 2 to be string, array given in /home/viparagl/public_html/matheson/includes/bootstrap.inc on line 761.

It happens only when I send invites to more than one email at a time. I've tried putting the emails on separate lines or just separating them by a comma.

The invites do go out, but the non-first person on the list doesn't get the custom message inviters can add. Instead they get a message that reads "Array".

Questions:
1) should your patch fix this error as well?
2) is the patch safe to use?

mac_perlinski’s picture

Yes this is the same problem, it will fix your problem and yes it is safe to use.

Mac

mdowsett’s picture

i just tried it and same result...the second person gets 'Array' as the personalized message added to the invite.

paganwinter’s picture

Subscribing...

mdowsett’s picture

I can still only send one invite at a time...

barrett’s picture

StatusFileSize
new2.31 KB

I think the problem was more basic than that, Mac. That field should be using check_plain.

I poked around and it seems to me that the problem stems from the use of the $message variable in multiple contexts (i.e., for the body of he message to be sent, to capture output of the drupal_mail call, and as the body of the message displayed on-screen to the sender) within invite_form_submit(). Changing that function to use a distinct variable name for the different contexts seems to have done the job on my system.

I'm attaching a patch. Please let me know what y'all think.

Barrett

paul2’s picture

Works for me!

zarudnyi’s picture

Thank you!

ckng’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

Delta Bridges’s picture

Hello there,
Has this patch been committed yet?
I am still getting the preg_match() expects parameter 2 to be string error.... and I have the latest stable version of Invite module.... from 19 april 2009 :)
Many thanks!
JJ

andypost’s picture

StatusFileSize
new773 bytes

Patch #7 is expensive - change only $message in loop is enough.

rudders’s picture

Will this patch be committed anytime soon . . . appears to be no contributor comments in this thread for a long time! Is this module in need of new maintainers??

friolator’s picture

I can confirm that this patch works as advertised. Would be nice to get this committed. We just realized that 100+ invites went out without critical text attached. ugh.

8ballsaysiwin’s picture

Confirmed #12 as well. Would be great to get this included.

smk-ka’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

andypost’s picture

Cool! A year passed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.