From e85bbc9e9c577efd4437a032463d4fd79da932b5 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Thu, 10 Sep 2015 10:57:12 -0400
Subject: [PATCH] random_bytes() can throw an exception in some cases, since PHP 7.0.0rc3
---
program/include/rcmail.php | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index faf7af8..b2ab79a 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -178,9 +178,11 @@
// set localization
setlocale(LC_ALL, $lang . '.utf8', $lang . '.UTF-8', 'en_US.utf8', 'en_US.UTF-8');
- // workaround for http://bugs.php.net/bug.php?id=18556
- if (PHP_VERSION_ID < 50500 && in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
- setlocale(LC_CTYPE, 'en_US.utf8', 'en_US.UTF-8');
+ // Workaround for http://bugs.php.net/bug.php?id=18556
+ // Also strtoupper/strtolower and other methods are locale-aware
+ // for these locales it is problematic (#1490519)
+ if (in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
+ setlocale(LC_CTYPE, 'en_US.utf8', 'en_US.UTF-8', 'C');
}
}
@@ -808,7 +810,7 @@
// remove old token from the path
$base_path = rtrim($base_path, '/');
- $base_path = preg_replace('/\/[a-f0-9]{' . strlen($token) . '}$/', '', $base_path);
+ $base_path = preg_replace('/\/[a-zA-Z0-9]{' . strlen($token) . '}$/', '', $base_path);
// this need to be full url to make redirects work
$absolute = true;
--
Gitblit v1.9.1