Harjotsingh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/365436 )

Change subject: Remove BadMethodCallException when zero is taken as answer in 
quiz
......................................................................

Remove BadMethodCallException when zero is taken as answer in quiz

Currently the quiz throws a BadMethodCallException when zero is taken
as the answer.This was due to the use of empty() function for checking
the input.

Bug: T169135
Change-Id: I717237e5bad1d74abea8c446b95eaf63eb2dad4b
---
M Question.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz 
refs/changes/36/365436/1

diff --git a/Question.php b/Question.php
index 9065c3f..802bba4 100644
--- a/Question.php
+++ b/Question.php
@@ -402,7 +402,7 @@
                        $maxlength = $input[3];
                }
                // Syntax error if there is no input text.
-               if ( empty( $input[1] ) ) {
+               if ( $input[1] === "" ) {
                        $value = 'value="???"';
                        $state = 'error';
                } else {

-- 
To view, visit https://gerrit.wikimedia.org/r/365436
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I717237e5bad1d74abea8c446b95eaf63eb2dad4b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
Gerrit-Branch: master
Gerrit-Owner: Harjotsingh <harjo...@ymail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to