Welcome to Geeklog Sunday, October 22 2017 @ 10:25 pm EDT

Polls Plugin vs. Suhosin

  • Contributed by:
  • Views: 7,078
Geeklog

We've had several reports from users who were unable to edit or delete polls. Typical symptoms were being thrown back to the list of polls, with the changes apparently not "sticking". In one case, the user was even told that he didn't have the proper permissions and was asked to log back into the site.

If you're running into this problem, check if you have the Suhosin patch for PHP installed on your server.

The problem, which only occurs with Geeklog 1.5.0 and 1.5.1, is that the new polls editor now has so many form variables that it runs over a limit set by the Suhosin patch. By default, that limit is 200 form variables, whereas the polls editor uses over 300.

Here's what you can do:

  • If you have access to the php.ini, you can raise Suhosin's limit, suhosin.post.max_vars, accordingly (see below).
  • The easier way is probably to limit the number of questions or options per question in Geeklog (in the Polls Configuration).

Rule of thumb: By default, Geeklog allows up to 10 questions and 10 options per question. Every option additionally has a field for the votes and a notes field. So that's 10*10*3 = 300 post variables right there, plus another 30 or so for the other fields (title of the poll, permissions, etc.). Reducing this to, say, 5 questions and 8 options per question gives you 5*8*3+30 = 150 post variables, which is safely below Suhosin's (default) limit. You may want to adjust this to your site's specific needs, also based on your existing polls.