]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Poll/Poll_response.php
AS output/input for poll responses
[quix0rs-gnu-social.git] / plugins / Poll / Poll_response.php
index b5204c71f0719ac651b44c80dedc2fb6072871be..03dd6f60b552104a91f853d6aa049ea839b44b4a 100644 (file)
@@ -158,10 +158,10 @@ class Poll_response extends Managed_DataObject
             $options = array();
         }
 
-        $opts = $poll->getOptions();
-        if ($selection < 1 || $selection > count($opts)) {
+        if (!$poll->isValidSelection($selection)) {
             throw new ClientException(_m('Invalid poll selection.'));
         }
+        $opts = $poll->getOptions();
         $answer = $opts[$selection - 1];
 
         $pr = new Poll_response();