From 1503ffd09c65d6b21bf9b800119f71e18f955680 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 19 Dec 2017 12:16:26 +0100 Subject: Fix FTBFS from Koschei, add upstream patch for PHP 7.2 --- a8777ae113732dd18f9cf04d825322f596fedac7.patch | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 a8777ae113732dd18f9cf04d825322f596fedac7.patch (limited to 'a8777ae113732dd18f9cf04d825322f596fedac7.patch') diff --git a/a8777ae113732dd18f9cf04d825322f596fedac7.patch b/a8777ae113732dd18f9cf04d825322f596fedac7.patch new file mode 100644 index 0000000..4f2f028 --- /dev/null +++ b/a8777ae113732dd18f9cf04d825322f596fedac7.patch @@ -0,0 +1,33 @@ +From a8777ae113732dd18f9cf04d825322f596fedac7 Mon Sep 17 00:00:00 2001 +From: Jan Schneider +Date: Mon, 13 Feb 2017 14:57:35 +0100 +Subject: [PATCH] Don't use each(). + +For modern PHP versions there is no improved performance or memory usage compared to foreach() anymore. Beside that it's deprecated in PHP 7.2. +--- + lib/Horde/String.php | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/lib/Horde/String.php b/lib/Horde/String.php +index 26dfcbc..aa8f990 100644 +--- a/lib/Horde/String.php ++++ b/lib/Horde/String.php +@@ -66,8 +66,7 @@ public static function convertCharset($input, $from, $to, $force = false) + + if (is_array($input)) { + $tmp = array(); +- reset($input); +- while (list($key, $val) = each($input)) { ++ foreach ($input as $key => $val) { + $tmp[self::_convertCharset($key, $from, $to)] = self::convertCharset($val, $from, $to, $force); + } + return $tmp; +@@ -84,7 +83,7 @@ public static function convertCharset($input, $from, $to, $force = false) + + $input = clone $input; + $vars = get_object_vars($input); +- while (list($key, $val) = each($vars)) { ++ foreach ($vars as $key => $val) { + $input->$key = self::convertCharset($val, $from, $to, $force); + } + return $input; -- cgit