File: 1010_fix-fix-accept-to-gettext.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 (40 lines) | stat: -rw-r--r-- 1,700 bytes parent folder | download | duplicates (2)
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
--- gosa.orig/include/accept-to-gettext.inc
+++ gosa/include/accept-to-gettext.inc
@@ -85,9 +85,9 @@ function find_match($curlscore,$curcscor
 
 function al2gt($gettextlangs, $mime) {
   /* default to "everything is acceptable", as RFC2616 specifies */
-  $acceptLang=(($_SERVER["HTTP_ACCEPT_LANGUAGE"] == '') ? '*' :
+  $acceptLang=(($_SERVER["HTTP_ACCEPT_LANGUAGE"] ?? '' == '') ? '*' :
   	$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
-  $acceptChar=(($_SERVER["HTTP_ACCEPT_CHARSET"] == '') ? '*' :
+  $acceptChar=(($_SERVER["HTTP_ACCEPT_CHARSET"] ?? '' == '') ? '*' :
   	$_SERVER["HTTP_ACCEPT_CHARSET"]);
   $alparts=@preg_split("/,/",$acceptLang);
   $acparts=@preg_split("/,/",$acceptChar);
@@ -147,12 +147,12 @@ function al2gt($gettextlangs, $mime) {
     $noct=@preg_split("/-/",$allang);
 
     $testvals=array(
-         array($alscores[$allang], $acscores[$gtcs]),
-	 array($alscores[$noct[0]], $acscores[$gtcs]),
-	 array($alscores[$allang], $acscores["*"]),
-	 array($alscores[$noct[0]], $acscores["*"]),
-	 array($alscores["*"], $acscores[$gtcs]),
-	 array($alscores["*"], $acscores["*"]));
+         array($alscores[$allang] ?? null, $acscores[$gtcs] ?? null),
+	 array($alscores[$noct[0]] ?? null, $acscores[$gtcs] ?? null),
+	 array($alscores[$allang] ?? null, $acscores["*"] ?? null),
+	 array($alscores[$noct[0]] ?? null, $acscores["*"] ?? null),
+	 array($alscores["*"] ?? null, $acscores[$gtcs] ?? null),
+	 array($alscores["*"] ?? null, $acscores["*"] ?? null));
 
     $found=FALSE;
     foreach($testvals as $tval) {
@@ -182,4 +182,4 @@ function al2gt($gettextlangs, $mime) {
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
\ No newline at end of file
+?>