File: 1002_php7-compat.patch

package info (click to toggle)
slbackup-php 0.4.5-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 588 kB
  • sloc: php: 983; makefile: 92; sh: 48
file content (31 lines) | stat: -rw-r--r-- 1,234 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
Description: Make slbackup-php PHP7 compatible (use explode instead of split)
Author: Wolfgang Schweer <wschweer@arcor.de>
Forwarded: https://salsa.debian.org/debian-edu/upstream/slbackup-php/-/commit/f803c503ee93bf1c43126245e32bafcaf3fab779

--- a/src/functions.php
+++ b/src/functions.php
@@ -75,7 +75,7 @@
 	$lang_accept = array () ; 
 	$lang_accept = explode (",", $_SERVER['HTTP_ACCEPT_LANGUAGE']); 
 	for ($i = 0 ; $i < count ($lang_accept) ; $i++ ) {
-	    $lang_accept[$i] = split(";", $lang_accept[$i]) ; 
+	    $lang_accept[$i] = explode(';', $lang_accept[$i]) ; 
 	    $lang_accept[$i] = $lang_accept[$i][0] ; 
 	}
 
@@ -101,13 +101,13 @@
 	$locales = array();
 	$locales_utf8 = array();
 	if (isset($found_locale) && !empty($lang_accept[0])) {
-	    $found_locale_tuple = split('_', $found_locale);
+	    $found_locale_tuple = explode('_', $found_locale);
 	    if (count($found_locale_tuple) > 1) {
 		$locales[] = $found_locale;
 		$locales_utf8[] = $found_locale.'.UTF-8';
 	    }
 	    foreach ($lang_accept as $lang) {
-		$lang_tuple = split('-',$lang);
+		$lang_tuple = explode('-',$lang);
 		if (count($lang_tuple) > 1) {
 		    $language = strtolower($lang_tuple[0]);
 		    $country = strtoupper($lang_tuple[1]);