Don't crash when preg_match returns empty array#30
Conversation
|
You are absolutely right and your patch solves the issue. I will publish soon a new version with your patch (of course you will be among the credits for this version). thank you again! |
|
Credit does not concern me too much, but I appreciate this! If you are able to cut the new release over the weekend, that would be really great! |
|
HI @mirekdlugosz, The new version also includes a couple of other fixes that were necessary to resolve two small bugs. In addition, I tried to replicate a bug that a wp-forum user had reported concerning automatic honeypots and the latest version of cf7, but despite trying various ways I was never able to reproduce his problem. I hope that cf7 antispam will be increasingly useful to you and thank you again for your contribution! |
|
@erikyo thank you! Don't worry about the delay :) . |
CF7 additional settings can be arbitrary strings, with constants around tags. Following are perfectly correct additional settings:
However, if you have such form and try to mark inbound message as spam / ham, cf7-antispam will crash with message similar to:
The reason is,
flamingo_subjectline does not match provided regular expression, but code assumes that regex will always match.With this patch, such line will be skipped.
In general, there are few cases that CF7 will consider valid, but this plugin will not (space between key and colon, unquoted value, value starting with constant string). But since plugin only ever cares about
flamingo_message, which can reasonably be assumed to contain only variable(s) placeholder(s), I decided to apply the least intrusive fix.