mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-12 05:22:35 +09:00
Fix #2093 error when submitted values are not in an array
This commit is contained in:
parent
ee52d17fee
commit
61c02929f2
1 changed files with 9 additions and 3 deletions
|
|
@ -94,13 +94,16 @@ class pollController extends poll
|
||||||
$val->checkcount = 1;
|
$val->checkcount = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($val->title && count($val->item))
|
if($val->title && is_array($val->item) && count($val->item))
|
||||||
{
|
{
|
||||||
$args->poll[] = $val;
|
$args->poll[] = $val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!count($args->poll)) throw new Rhymix\Framework\Exception('cmd_null_item');
|
if(!isset($args->poll) || !is_array($args->poll) || !count($args->poll))
|
||||||
|
{
|
||||||
|
throw new Rhymix\Framework\Exception('cmd_null_item');
|
||||||
|
}
|
||||||
|
|
||||||
$args->stop_date = $stop_date;
|
$args->stop_date = $stop_date;
|
||||||
|
|
||||||
|
|
@ -307,7 +310,10 @@ class pollController extends poll
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is no response item, display an error
|
// If there is no response item, display an error
|
||||||
if(!count($item_srls)) throw new Rhymix\Framework\Exception('msg_check_poll_item');
|
if(!is_array($item_srls) || !count($item_srls))
|
||||||
|
{
|
||||||
|
throw new Rhymix\Framework\Exception('msg_check_poll_item');
|
||||||
|
}
|
||||||
// Make sure is the poll has already been taken
|
// Make sure is the poll has already been taken
|
||||||
$oPollModel = getModel('poll');
|
$oPollModel = getModel('poll');
|
||||||
if($oPollModel->isPolled($poll_srl)) throw new Rhymix\Framework\Exception('msg_already_poll');
|
if($oPollModel->isPolled($poll_srl)) throw new Rhymix\Framework\Exception('msg_already_poll');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue