[BUGFIX] Encryption utility method throws warning for empty string
authorAndreas Wolf <andreas.wolf@typo3.org>
Fri, 13 Apr 2012 13:04:17 +0000 (15:04 +0200)
committerAndreas Wolf <andreas.wolf@typo3.org>
Fri, 13 Apr 2012 13:04:17 +0000 (15:04 +0200)
Classes/Utility/Encryption.php

index b73f8d7..cd6e448 100644 (file)
@@ -101,11 +101,15 @@ class Tx_FalWebdav_Utility_Encryption {
        /**
         * Decrypts a password. The necessary initialization vector is extracted from the password.
         *
-        * @param $encryptedPassword
+        * @param string $encryptedPassword
         * @return string
         * @see encryptPassword()
         */
        public static function decryptPassword($encryptedPassword) {
+               if ($encryptedPassword == '') {
+                       return '';
+               }
+
                if (substr_count($encryptedPassword, '$') > 0) {
                        $passwordParts = t3lib_div::trimExplode('$', $encryptedPassword, TRUE);
                                // Base64 decoding the password is done below