commit ccb98144069c21369991d260b81969a5190183cc
Author: Mark Jayson Gruta <jhayzhon@gmail.com>
Date:   Wed Feb 25 15:51:15 2015 +0800

    Allow execution of extra validation to advpoll_choice_form

diff --git a/advpoll.module b/advpoll.module
index 5891260..b75c442 100644
--- a/advpoll.module
+++ b/advpoll.module
@@ -675,6 +675,13 @@ function advpoll_writein_callback($form, $form_state) {
  * Submit handler for voting
  */
 function advpoll_form_submit($form, &$form_state) {
+  // Validate the form.
+  drupal_validate_form('advpoll_choice_form', $form, $form_state);
+  // if there are errors, return the form to display the error messages
+  if (form_get_errors()) {
+    $form_state['rebuild'] = TRUE;
+    return $form;
+  }
   $data = advpoll_get_form_data($form_state);
   $count = count($data->choices);
   $votes = $form[$count]['#value'];
