Merge pull request #3753 from colemanw/fee
[civicrm-core.git] / CRM / Utils / ReCAPTCHA.php
index efad639019fc9754aec750bebac6fab311f626f8..6b07762614cc47d980e82f8018016d85861716ab 100644 (file)
@@ -67,6 +67,9 @@ class CRM_Utils_ReCAPTCHA {
     return self::$_singleton;
   }
 
+  /**
+   *
+   */
   function __construct() {}
 
   /**
@@ -77,7 +80,9 @@ class CRM_Utils_ReCAPTCHA {
     $error  = NULL;
     $config = CRM_Core_Config::singleton();
     $useSSL = FALSE;
-    require_once 'packages/recaptcha/recaptchalib.php';
+    if ( !function_exists( 'recaptcha_get_html' ) ) {
+      require_once 'packages/recaptcha/recaptchalib.php';
+    }
 
     // See if we are using SSL
     if (CRM_Utils_System::isSSL()) {
@@ -109,6 +114,12 @@ class CRM_Utils_ReCAPTCHA {
     );
   }
 
+  /**
+   * @param $value
+   * @param $form
+   *
+   * @return mixed
+   */
   static function validate($value, $form) {
     $config = CRM_Core_Config::singleton();