I'm getting this PHP warning on certain pages when an anonymous user. This is caused by test_flagged_by_current_user() returning a FALSE value, though validate_argument() needs an empty array in this case. Here's a one-line patch which fixes the error.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1462000.flag_.argument-plugin-anonymous-warning.patch | 735 bytes | joachim |
| flag-anonymous-php-warning.patch | 551 bytes | joelstein |
Comments
Comment #1
joachim commentedI'm not sure what this fix is fixing.
Surely with the else statement, $passed will either be the return from the $method, or an empty array?
Or am I being dense and missing something?
Comment #2
joachim commentedAh I think I get it.
This is the better fix, I think: fix what the method returns.
Comment #3
socketwench commentedLooks good. Tests clean.
Comment #4
joachim commentedCommitted. Thanks!
Issue #1462000 by joachim, joelstein: Fixed incorrect value returned by argument flaggability check.
Comment #5
joachim commentedBackported to both 6--2 and 6--1.
(@socketwench: btw, handy tip: quick way to see if a patch backports is to check out into the older branch and do 'git cherry-pick [SHA]'. If the patch applies, you get the commit made for you too.)