]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/filter/crypto/class_CaptchaEncryptFilter.php
Continued:
[core.git] / framework / main / classes / filter / crypto / class_CaptchaEncryptFilter.php
index 128e06fab9ef40b81799e930b4936d639f810088..aaab8dff42b178f79a0df145b876a14a575c89db 100644 (file)
@@ -3,7 +3,8 @@
 namespace Org\Mxchange\CoreFramework\Filter\Captcha;
 
 // Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
@@ -15,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -38,7 +39,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -71,26 +72,26 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable {
                // Is it there?
                if (is_null($encryptRequest)) {
                        // Not found, so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Throw exception
                        throw new EncryptMissingException($this, CryptoHelper::EXCEPTION_ENCRYPT_MISSING);
-               } // END - if
+               }
 
                // Decode it fully
                $encryptDecoded = base64_decode(str_replace(' ', '+', urldecode($encryptRequest)));
 
                // Get a crypto helper and decrypt the string
-               $decryptedString = ObjectFactory::createObjectByConfiguredName('crypto_class')->decryptString($encryptDecoded);
+               $decryptedString = CryptoHelper::getSelfInstance()->decryptString($encryptDecoded);
 
                // Is it the expected length?
-               if (strlen($decryptedString) != $this->getConfigInstance()->getConfigEntry('captcha_string_length')) {
+               if (strlen($decryptedString) != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_string_length')) {
                        // Not found, so request is invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Throw exception
                        throw new EncryptInvalidLengthException($this, CryptoHelper::EXCEPTION_ENCRYPT_INVALID);
-               } // END - if
+               }
 
                // Write it to the request
                $requestInstance->setRequestElement('decrypted', $decryptedString);