Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+6 -6
View File
@@ -11,7 +11,7 @@
namespace IPS\Helpers\Form;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -48,7 +48,7 @@ class _Poll extends FormAbstract
{
$json = array();
if ( $this->value AND is_array( $this->value->choices ) AND count( $this->value->choices ) )
if ( $this->value AND \is_array( $this->value->choices ) AND \count( $this->value->choices ) )
{
foreach ( $this->value->choices as $k => $choice )
{
@@ -158,11 +158,11 @@ EOF;
}
/* Do we have at least one question? */
if ( !count( $this->value->choices ) )
if ( !\count( $this->value->choices ) )
{
throw new \InvalidArgumentException('form_poll_no_questions');
}
if ( count( $this->value->choices ) > \IPS\Settings::i()->max_poll_questions )
if ( \count( $this->value->choices ) > \IPS\Settings::i()->max_poll_questions )
{
throw new \InvalidArgumentException( \IPS\Member::loggedIn()->language()->addToStack('form_poll_too_many_questions', FALSE, array( 'pluralize' => array( \IPS\Settings::i()->max_poll_questions ) ) ) );
}
@@ -170,11 +170,11 @@ EOF;
/* Do all the questions have at least 2 options? */
foreach ( $this->value->choices as $question )
{
if ( count( $question['choice'] ) < 2 )
if ( \count( $question['choice'] ) < 2 )
{
throw new \InvalidArgumentException('form_poll_too_few_answers');
}
if ( count( $question['choice'] ) > \IPS\Settings::i()->max_poll_choices )
if ( \count( $question['choice'] ) > \IPS\Settings::i()->max_poll_choices )
{
throw new \InvalidArgumentException( \IPS\Member::loggedIn()->language()->addToStack('form_poll_too_many_answers', FALSE, array( 'sprintf' => array( \IPS\Settings::i()->max_poll_choices ) ) ) );
}