File: 1054_utf8-decode-is-deprecated.patch

package info (click to toggle)
gosa 2.8~git20230203.10abe45%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,108 kB
  • sloc: php: 32,102; javascript: 10,836; pascal: 3,776; xml: 3,135; sh: 852; python: 162; makefile: 45; perl: 2
file content (16 lines) | stat: -rw-r--r-- 598 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: Stop using utf8_decode anymore.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Comment: The code contains more places at more rarely used
 code paths.

--- a/include/password-methods/class_password-methods.inc
+++ b/include/password-methods/class_password-methods.inc
@@ -388,7 +388,7 @@
 
         if ($config->boolValueIsTrue("core","strictPasswordRules")) {
             // Do we have UTF8 characters in the password?
-            return ($password == utf8_decode($password));
+            return mb_detect_encoding($password, "UTF-8");
         }
 
         return(true);