BUGFIX: fixed selection of spade and heart solo
authorArun Persaud <arun@nubati.net>
Tue, 17 Sep 2013 00:10:44 +0000 (17:10 -0700)
committerArun Persaud <arun@nubati.net>
Tue, 17 Sep 2013 00:10:44 +0000 (17:10 -0700)
two typos messed up the solo selction, e.g. the gametype was not the same as the one given in the
enum in the database. Also added an additional check before we set them in the database, so that people
can mess things up when playing with the url directly.

include/game.php
include/output.php

index 7c8064c4e181d5cbb7c1e7c4977120ce676a1cce..86fd53ccf4c7066afc50a88bc469202e499c0a4a 100644 (file)
@@ -571,6 +571,17 @@ switch($mystatus)
              {
                /* user wants to play a solo */
 
+               /* double check input value */
+               $s = $_REQUEST['solo'];
+               $solos = array('trumpless','jack','queen','trump','club','spade','heart');
+               if (!in_array($s, $solos))
+                 {
+                   $messages[] = sprintf(_('There is a problem with the type of solo you selected (%s does not exist), please go back '.
+                                           'and answer the <a href="%s">question</a> again.'),
+                                         $s,$INDEX.'?action=game&amp;me=$me&amp;in=yes');
+                   break;
+                 }
+
                /* store the info in the user's hand info */
                DB_set_solo_by_hash($me,$_REQUEST['solo']);
                DB_set_sickness_by_hash($me,'solo');
index 6e5f15f9465e975baf41e24927126d410753491e..6a61b085aecfae99b5c1f4c1fecccb80eb070f47 100644 (file)
@@ -274,8 +274,8 @@ function output_check_for_sickness($me,$mycards)
   echo '      <option value="queen">'._('queen').'</option>';
   echo '      <option value="jack">'._('jack').'</option>';
   echo '      <option value="club">'._('club').'</option>';
-  echo '      <option valvue="spade">'._('spade').'</option>';
-  echo '      <option value="hear">'._('heart').'</option>';
+  echo '      <option value="spade">'._('spade').'</option>';
+  echo '      <option value="heart">'._('heart').'</option>';
   echo '    </select>';
   echo '    <br />';