MyBB Community Forums

Full Version: Plugin - Poll Manager - PHP error - by juventiner
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Reg. PollManager / Extended Polls plugin

is there anybody who can help me to fix this PHP warnings?

[Image: XedSd9x.png]

Moreover there is one bug in time/day function - it is always 1 hours behind my current time Sad not a big issue, auto detection si maybe broken
Replace line 647 in inc/plugins/extendedpolls.php

Original
if(count($mybb->input['vote']) <= 0)

New
if(!isset($mybb->input['vote']))
Thank you buddy!

Is the original author still active or the project is abandoned? This plugin is great but I miss few basic features - edit poll, display voters or undo my vote
(2020-02-01, 12:33 PM)Crazycat Wrote: [ -> ]Replace line 647 in inc/plugins/extendedpolls.php

Original
if(count($mybb->input['vote']) <= 0)

New
if(!isset($mybb->input['vote']))
Hi,
You've fixed the error, but you've also changed the logic.

Better solution:
Change:
if(count($mybb->input['vote']) <= 0)

To:
if(count($mybb->input['vote'] ?? []) <= 0)

But few lines up and down the author also used $mybb->input['vote'] and the error can still appear in the future.
I didn't read the whole plugin, peharps it has to be entirely corrected.
btw, I'd better use !empty() than !isset() to keep the logic, but I correct the error quickly without testing.
Guys, great thx.