]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php
Fixes for template engine
[shipsimu.git] / inc / classes / main / helper / captcha / web / class_GraphicalCodeCaptcha.php
index d40a1ba146ce660a40931adccea702d04602a836..64f5788575939bdf584bfb48fc74a0c21722f1f0 100644 (file)
@@ -120,11 +120,11 @@ class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha {
                // Get crypto instance
                $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
 
+               // Hash the CAPTCHA code for later comparison
+               $this->hashedString = $cryptoInstance->hashString($captchaString);
+
                // Encrypt the string for later usage
                $this->encryptedString = $cryptoInstance->encryptString($captchaString);
-
-               // Hash the encrypted string for later comparison
-               $this->hashedString = $cryptoInstance->hashString($this->encryptedString);
        }
 
        /**
@@ -136,8 +136,9 @@ class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha {
                // Load a template for this CAPTCHA
                $this->getTemplateInstance()->loadCodeTemplate("captch_graphic_code");
 
-               // Assign variable
+               // Assign variables
                $this->getTemplateInstance()->assignVariable('encrypted_code', urlencode(base64_encode($this->encryptedString)));
+               $this->getTemplateInstance()->assignVariable('captcha_hash', $this->hashedString);
 
                // Compile the template
                $this->getTemplateInstance()->compileTemplate();