PHP 8.0 compatibility
Bernd Wurst

Bernd Wurst commited on 2020-12-09 07:52:39
Zeige 5 geänderte Dateien mit 19 Einfügungen und 13 Löschungen.

... ...
@@ -39,7 +39,7 @@ class DB extends PDO
39 39
     /*
40 40
       Wenn Parameter übergeben werden, werden Queries immer als Prepared statements übertragen
41 41
     */
42
-    public function query($stmt, $params = null, $allowempty = false)
42
+    public function myquery($stmt, $params = null, $allowempty = false)
43 43
     {
44 44
         if (is_array($params)) {
45 45
             if (config("enable_debug") && !$allowempty) {
... ...
@@ -131,7 +131,7 @@ function db_query($stmt, $params = null, $allowempty = false)
131 131
         DEBUG($params);
132 132
     }
133 133
     try {
134
-        $result = $_db->query($stmt, $params, $allowempty);
134
+        $result = $_db->myquery($stmt, $params, $allowempty);
135 135
         DEBUG('=> '.$result->rowCount().' rows');
136 136
     } catch (PDOException $e) {
137 137
         global $debugmode;
... ...
@@ -3,7 +3,7 @@
3 3
     "description": "Webinterface running at config.schokokeks.org",
4 4
     "license": "CC0-1.0",
5 5
     "require": {
6
-        "bjeavons/zxcvbn-php": "^0.3",
6
+        "bjeavons/zxcvbn-php": "^1.2",
7 7
         "giggsey/libphonenumber-for-php": "^8.8",
8 8
         "globalcitizen/php-iban": "^2.7.1",
9 9
         "mpdf/mpdf": "^8.0",
... ...
@@ -4,28 +4,30 @@
4 4
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 5
         "This file is @generated automatically"
6 6
     ],
7
-    "content-hash": "0e373e5456d6d408e3d54d34d360c96c",
7
+    "content-hash": "2ddcdd91f6d49f93b298d93060d37034",
8 8
     "packages": [
9 9
         {
10 10
             "name": "bjeavons/zxcvbn-php",
11
-            "version": "0.3.0",
11
+            "version": "1.2.0",
12 12
             "source": {
13 13
                 "type": "git",
14 14
                 "url": "https://github.com/bjeavons/zxcvbn-php.git",
15
-                "reference": "331a88932d1a399c989967d3399a4a40eb182fd5"
15
+                "reference": "13b505d53c6e72a8fce7f42e3392f13642bbf65e"
16 16
             },
17 17
             "dist": {
18 18
                 "type": "zip",
19
-                "url": "https://api.github.com/repos/bjeavons/zxcvbn-php/zipball/331a88932d1a399c989967d3399a4a40eb182fd5",
20
-                "reference": "331a88932d1a399c989967d3399a4a40eb182fd5",
19
+                "url": "https://api.github.com/repos/bjeavons/zxcvbn-php/zipball/13b505d53c6e72a8fce7f42e3392f13642bbf65e",
20
+                "reference": "13b505d53c6e72a8fce7f42e3392f13642bbf65e",
21 21
                 "shasum": ""
22 22
             },
23 23
             "require": {
24
-                "php": "^5.3 || ^7.0"
24
+                "php": "^7.2 | ^8.0",
25
+                "symfony/polyfill-mbstring": ">=1.3.1"
25 26
             },
26 27
             "require-dev": {
27
-                "phpunit/phpunit": "*",
28
-                "satooshi/php-coveralls": "*"
28
+                "php-coveralls/php-coveralls": "*",
29
+                "phpunit/phpunit": "^8.5",
30
+                "squizlabs/php_codesniffer": "3.*"
29 31
             },
30 32
             "type": "library",
31 33
             "autoload": {
... ...
@@ -49,7 +51,7 @@
49 51
                 "password",
50 52
                 "zxcvbn"
51 53
             ],
52
-            "time": "2017-01-06T15:43:33+00:00"
54
+            "time": "2020-11-30T16:47:23+00:00"
53 55
         },
54 56
         {
55 57
             "name": "giggsey/libphonenumber-for-php",
... ...
@@ -22,7 +22,7 @@ function icon_warning($title = '')
22 22
     return "<img src=\"{$prefix}images/warning.png\" style=\"height: 16px; width: 16px;\" alt=\"{$title}\" title=\"{$title}\" />";
23 23
 }
24 24
 
25
-function icon_enabled_phpxx($title = '', $major, $minor)
25
+function icon_enabled_phpxx($title, $major, $minor)
26 26
 {
27 27
     global $prefix;
28 28
     return "<img src=\"{$prefix}images/ok-php$major$minor.png\" style=\"height: 16px; width: 16px;\" alt=\"{$title}\" title=\"{$title}\" />";
... ...
@@ -45,7 +45,11 @@ function strong_password($password, $user = array())
45 45
     // Kein Online-Check eingerichtet oder der request war nicht erfolgreich
46 46
     DEBUG('using Zxcvbn for password check!');
47 47
     $passwordchecker = new ZxcvbnPhp\Zxcvbn();
48
+    if ($user) {
48 49
         $strength = $passwordchecker->passwordStrength($password, $user);
50
+    } else {
51
+        $strength = $passwordchecker->passwordStrength($password);
52
+    }
49 53
     DEBUG('password strength: '.$strength['score']);
50 54
     if ($strength['score'] < 2) {
51 55
         return "Das Passwort ist zu einfach!";
52 56