Changes made in ref to master
authorKartik Kathuria <kathuriakartik0@gmail.com>
Thu, 29 Apr 2021 22:14:21 +0000 (03:44 +0530)
committerKartik Kathuria <kathuriakartik0@gmail.com>
Thu, 29 Apr 2021 22:14:21 +0000 (03:44 +0530)
CRM/Contribute/Form/Contribution/Main.php
ext/recaptcha/CRM/Utils/ReCAPTCHA.php

index 68a99aec74b774d192674f26d5d5f2bda41fe5ee..738e1f1fcacc3e98041589b39e56313c645eee4a 100644 (file)
@@ -290,7 +290,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $this->buildComponentForm($this->_id, $this);
     }
 
-    if (count($this->_paymentProcessors) >= 1 && !$this->get_template_vars("isCaptcha") && $this->hasToAddForcefully()) {
+    if (count($this->_paymentProcessors) >= 1 && !$this->get_template_vars("isCaptcha") && \Civi::settings()->get('forceRecaptcha')) {
       if (!$this->_userID) {
         CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this);
       }
index db2664e56b55a36f98a6d8fa8eb2caf38753eec8..c5e841781892f521fd8e282594173fc56259d0d2 100644 (file)
@@ -55,13 +55,6 @@ class CRM_Utils_ReCAPTCHA {
     return (bool) \Civi::settings()->get('recaptchaPublicKey');
   }
 
-  /**
-   * Check if reCaptcha has to be added on form forcefully.
-   */
-  public static function hasToAddForcefully() {
-    return (bool) \Civi::settings()->get('forceRecaptcha');
-  }
-
   /**
    * Add element to form.
    *