Skip to content

Commit

Permalink
less stringent q&a text formatting; better J4 form styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ron4mac committed Sep 8, 2022
1 parent cf1f590 commit b4de96f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions qa.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function onDisplay ($name, $id, $class)
$rq = (rand() % 9) + 1;
$tm = time();
$sf = ($rq * $tm) % 97;
$fld = '<br><input type="text" '.$class.' id="'.$id.'" name="'.$name.'" required="required" aria-required="true" value="" />';
$fld = '<br><input type="text" class="form-control'.($class?' '.$class:'').'" id="'.$id.'" name="'.$name.'" required="required" aria-required="true" value="" />';
$ccd = '<input type="hidden" name="captcha_code" value="'."{$rq}-{$tm}-{$sf}".'" />';
$label = '<span>'.Text::_('PLG_CAPTCHA_QA_LABEL_PLEASE').'</span>';
$qa = Text::_('PLG_CAPTCHA_QA_Q'.$rq);
Expand Down Expand Up @@ -75,7 +75,7 @@ public function onCheckAnswer ($code)
$qa = Text::_('PLG_CAPTCHA_QA_Q'.$qn);
list($q,$a) = explode('|',$qa);
$cas = explode(',',trim($a));
if (in_array(trim($code),$cas)) {
if (in_array(trim($code), array_map('trim', $cas))) {
return true;
}
$app->enqueueMessage(Text::_('PLG_CAPTCHA_QA_ERROR_NOT_HUMAN').' '.Text::_('PLG_CAPTCHA_QA_ERROR_INCORRECT'), 'error');
Expand Down
4 changes: 2 additions & 2 deletions qa.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.0" type="plugin" group="captcha" method="upgrade">
<name>PLG_CAPTCHA_QA</name>
<version>1.4.1</version>
<creationDate>May 2022</creationDate>
<version>1.4.2</version>
<creationDate>September 2022</creationDate>
<author>Ron Crans</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>rjconline.net</authorUrl>
Expand Down

0 comments on commit b4de96f

Please sign in to comment.