From bb2113ccdcfb2eb3c7b04c161a6b21ef893eee7e Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 31 Mar 2015 07:51:59 -0400
Subject: [PATCH] Fix zipped messages downloads after selecting all messages in a folder (#1490339)

---
 plugins/password/drivers/sql.php |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/plugins/password/drivers/sql.php b/plugins/password/drivers/sql.php
index ab348dd..37e162e 100644
--- a/plugins/password/drivers/sql.php
+++ b/plugins/password/drivers/sql.php
@@ -66,8 +66,10 @@
                 $len = 2;
                 break;
             case 'blowfish':
-                $len = 22;
-                $salt_hashindicator = '$2a$';
+                $cost = (int) $rcmail->config->get('password_blowfish_cost');
+                $cost = $cost < 4 || $cost > 31 ? 12 : $cost;
+                $len  = 22;
+                $salt_hashindicator = sprintf('$2a$%02d$', $cost);
                 break;
             case 'sha256':
                 $len = 16;

--
Gitblit v1.9.1