summaryrefslogtreecommitdiffstats
path: root/2.patch
blob: 0f5cfe87df4b9b433a50cbdfaee6758eeb48dcf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 70e66e65fd0739f7176793b013101b0120e19ee8 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 1 Oct 2019 14:56:42 +0200
Subject: [PATCH 1/2] Fix Function get_magic_quotes_gpc() is deprecated (7.4)

---
 lib/Horde/Util.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Horde/Util.php b/lib/Horde/Util.php
index 4d16bb8..d6067a1 100644
--- a/lib/Horde/Util.php
+++ b/lib/Horde/Util.php
@@ -114,7 +114,7 @@ public static function pformInput($append_session = 0)
     public static function dispelMagicQuotes($var)
     {
         if (is_null(self::$_magicquotes)) {
-            self::$_magicquotes = get_magic_quotes_gpc();
+            self::$_magicquotes = function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc();
         }
 
         if (self::$_magicquotes) {

From 468e497990e238fd40b88d991762c8a2f8a6c29e Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 17 Oct 2019 15:18:47 +0200
Subject: [PATCH 2/2] Fix Invalid characters passed for attempted conversion

New warning raised in PHP 7.4
as uniqid generated a hexa string, switch to base 16
---
 lib/Horde/Util.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Horde/Util.php b/lib/Horde/Util.php
index d6067a1..d6d111d 100644
--- a/lib/Horde/Util.php
+++ b/lib/Horde/Util.php
@@ -304,7 +304,7 @@ public static function createTempDir($delete = true, $temp_dir = null)
         /* Get the first 8 characters of a random string to use as a temporary
            directory name. */
         do {
-            $new_dir = $temp_dir . '/' . substr(base_convert(uniqid(mt_rand()), 10, 36), 0, 8);
+            $new_dir = $temp_dir . '/' . substr(base_convert(uniqid(mt_rand()), 16, 36), 0, 8);
         } while (file_exists($new_dir));
 
         $old_umask = umask(0000);