? ? Pending

User tests: Successful: Unsuccessful:

avatar oleg-kosarev
oleg-kosarev
16 Aug 2018

Pull Request for Issue #21643 .

Steps to reproduce the issue

Use recaptcha plugin in custom component. Use multiple instances of it so each instance has it's own input name.

When you call the recaptcha plugin to validate you can pass the $code to validate instead of the "standard" code from input.

see the function declaration: public function onCheckAnswer($code = null)

e.g.

$alldata = JFactory::getApplication()->input;
$cresponse = $alldata->get('grecaptcharesponse','','string'); //here we have the catcha code to validate

//call captcha plugin to validate code
JPluginHelper::importPlugin('captcha');
$dispatcher = JEventDispatcher::getInstance();

$res = $dispatcher->trigger('onCheckAnswer',$cresponse);

Testing Instructions

Setting | Value
PHP Built On | Windows NT DESKTOP-I8R3T2F 10.0 build 17134 (Windows 10) AMD64
Database Type | mysql
Database Version | 5.5.45
Database Collation | utf8_general_ci
Database Connection Collation | utf8mb4_general_ci
PHP Version | 7.2.7
Web Server | Microsoft-IIS/10.0
WebServer to PHP Interface | cgi-fcgi
Joomla! Version | Joomla! 3.8.11 Stable [ Amani ] 31-July-2018 14:00 GMT
Joomla! Platform Version | Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

Expected result

true if vaild
false if faild

Actual result

Always False

Documentation Changes Required

if params $code not empty $respone = $code
if send params get g-recaptcha-response $respone = $input->get('g-recaptcha-response', '', 'string');
else $response = '';

avatar oleg-kosarev oleg-kosarev - open - 16 Aug 2018
avatar oleg-kosarev oleg-kosarev - change - 16 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Aug 2018
Category Front End Plugins
avatar oleg-kosarev oleg-kosarev - change - 16 Aug 2018
The description was changed
avatar oleg-kosarev oleg-kosarev - edited - 16 Aug 2018
avatar oleg-kosarev oleg-kosarev - change - 16 Aug 2018
The description was changed
avatar oleg-kosarev oleg-kosarev - edited - 16 Aug 2018
avatar oleg-kosarev
oleg-kosarev - comment - 16 Aug 2018

@franz-wohlkoenig This error will be fixed in joomla 3.8.12?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Aug 2018

this Pull Request needs 2 successfully Tests (not by Developer of PR). Than decide Maintaners if merged or not.

Thats the Standard-Procedere for Pull Requests.

avatar wilsonge wilsonge - change - 16 Aug 2018
Labels Added: ?
avatar twister65
twister65 - comment - 22 Sep 2018

I have tested this item successfully on 4273c55

Successfully tested with reCaptcha and the new implemented reCaptcha invisible plugins, as follows :

  • Install this patch and the another one : PR #22270

  • Test the code posted in jcomments.ajax.php :
    $jinput = JFactory::getApplication()->input;
    $post = $jinput->getArray($_POST);
    $code = $post["g_recaptcha_response"]; //here we have the captcha code to validate

    JPluginHelper::importPlugin('captcha', "recaptcha_invisible");
    $dispatcher = JEventDispatcher::getInstance();
    try
    {
    $res = $dispatcher->trigger('onCheckAnswer',$code);
    }
    catch (Exception $e)
    {
    self::showErrorMessage($e->getMessage());
    $response->addScript("grecaptcha.reset()");
    return $response;
    }


    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21651.

avatar twister65 twister65 - test_item - 22 Sep 2018 - Tested successfully
avatar twister65
twister65 - comment - 22 Sep 2018

@oleg-kosarev , please add changes to :

public function onCheckAnswer($code = null)

I did it myself for the test.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 Apr 2019

@oleg-kosarev can you make the changes @twister65 suggested at #21651 (comment)?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 12 May 2019

I suggest to close this PR due the lack of response by @oleg-kosarev or @twister65 can make the changes? In the meantime i add the label "needs new owner".

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Jul 2019

@twister65 can you apply the changes or should this Pull Request be closed?

avatar twister65
twister65 - comment - 27 Jul 2019

@franz-wohlkoenig , I think you can close this PR because the user code is not necessary for the implementation of recaptcha:

* @param string $code Answer provided by user. Not needed for the Recaptcha implementation

I'm waiting for a new PR that implements ajax support in the recaptcha plugin.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Jul 2019

Closed as stated above.

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Jul 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-07-27 14:47:26
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig franz-wohlkoenig - close - 27 Jul 2019

Add a Comment

Login with GitHub to post a comment