Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spam Hurdles 2.0.2 Bug #896

Closed
yupri opened this issue Jun 11, 2014 · 2 comments
Closed

Spam Hurdles 2.0.2 Bug #896

yupri opened this issue Jun 11, 2014 · 2 comments

Comments

@yupri
Copy link

yupri commented Jun 11, 2014

Well, we've caught a bug related to Spam Hurdles module. I was able to reproduce it at different Phorum setups even at a newly clean one.

We are on
Phorum 5.2.19,
Spam Hurdles 2.0.2.
(nginx 1.2.4
PHP 5.3.21
MySQL 5.1.67)

Okay, if we turn on spam hurdles with default settings and approve "Enable Caching Messages" in Cache Settings here is what happens. Let's say a user posts a new topic message, which is sent to moderation by the Spam Hurdles module.
Then if a moderator goes to that new topic message, there is a number of warnings popping up like those:

Notice: Undefined index: message_ids in [phorum_dir]/read.php on line 270

Warning: sort() expects parameter 1 to be array, null given in [phorum_dir]/read.php on line 276

Warning: array_slice() expects parameter 1 to be array, null given in [phorum_dir]/read.php on line 305

Warning: Invalid argument supplied for foreach() in [phorum_dir]/read.php on line 325 

The reason for those warnings is a PHP code block related to cache regime for the message.
It tries to read data from cache represented by phorum_messages.meta field. It expects either message_ids or message_ids_moderator but it's empty in that field. It gets null instead of an array. And after trying to apply array operations to a null value we get abeforementioned warnings.

If caching messages is turned off moderator doesn't see the warnings. Because message data is read and rebuild from database and everything goes well.

This problem doesn't bother much. It can be deflected by suppressing errors. But anyway this shouldn't be the way the code logic is organized.

Please comment on this issue and possibly provide a solution vector.

Best wishes!

P. S.
Also posted it here:
http://www.phorum.org/phorum5/read.php?62,141836,155098,page=5#msg-155098

@oricgn oricgn self-assigned this Sep 11, 2015
@oricgn oricgn added this to the Phorum 5.2.x - Next Stable milestone Sep 11, 2015
@oricgn
Copy link
Contributor

oricgn commented Sep 11, 2015

Hi Yupri,

Well, we've caught a bug related to Spam Hurdles module. I was able to reproduce it at different Phorum setups even at a newly clean one.

I tried to figure out the problem, but I wasn't able to reproduce it.

I think you have a problem with serialize/unserialize the meta column. "message_ids" is stored as serialized data in this field and the "message_ids" value is always included. It shouldn't be possible that "message_ids" is missing.

Is it possible, that you make some more tests? Please contact me via PM.

Regards
Oliver

@oricgn
Copy link
Contributor

oricgn commented Sep 11, 2015

Duplicate to issue #838. Closing.

@oricgn oricgn closed this as completed Sep 11, 2015
@Phorum Phorum locked and limited conversation to collaborators Sep 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants