From ff958f0ee676ca48671a57812ac2fe15f337a1b0 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Wed, 5 Mar 2014 14:11:16 -0500
Subject: [PATCH] Don't try to encrypt/decrypt empty values. - Resolves
 VUFIND-963.

---
 module/VuFind/src/VuFind/Db/Row/User.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/module/VuFind/src/VuFind/Db/Row/User.php b/module/VuFind/src/VuFind/Db/Row/User.php
index 43504c336bd..dbc1d5bc4f5 100644
--- a/module/VuFind/src/VuFind/Db/Row/User.php
+++ b/module/VuFind/src/VuFind/Db/Row/User.php
@@ -146,6 +146,11 @@ class User extends ServiceLocatorAwareGateway
      */
     protected function encryptOrDecrypt($text, $encrypt = true)
     {
+        // Ignore empty text:
+        if (empty($text)) {
+            return $text;
+        }
+
         // Load encryption key from configuration if not already present:
         if (null === $this->encryptionKey) {
             $config = $this->getServiceLocator()->getServiceLocator()
-- 
GitLab