Bug#821659: make slbackup-php PHP 7.0 compliant

Wolfgang Schweer wschweer at arcor.de
Mon May 16 18:04:46 UTC 2016


This patch should be enough, no need to package newer upstream release
(the split() function is deprecated since PHP 5.3.0 and gone in 7.0).


diff --git a/debian/control b/debian/control
index 68f7eac..1b15544 100644
--- a/debian/control
+++ b/debian/control
@@ -17,12 +17,12 @@ Package: slbackup-php
 Architecture: all
 Depends:
  ${misc:Depends},
- libapache2-mod-php5 | php5-cgi,
+ php,
  apache2 | httpd,
  ssh,
- php5-cli,
+ php-cli,
  smarty3,
- smarty-gettext (>= 1.0b1-7),
+ smarty-gettext,
 Suggests:
  x-www-browser,
  slbackup,
diff --git a/src/functions.php b/src/functions.php
index 7f52734..89524da 100644
--- a/src/functions.php
+++ b/src/functions.php
@@ -75,7 +75,7 @@ function loadLocale () {
 	$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] = preg_split(';', $lang_accept[$i]) ;
 	    $lang_accept[$i] = $lang_accept[$i][0] ; 
 	}
 
@@ -101,13 +101,13 @@ function loadLocale () {
 	$locales = array();
 	$locales_utf8 = array();
 	if (isset($found_locale) && !empty($lang_accept[0])) {
-	    $found_locale_tuple = split('_', $found_locale);
+	    $found_locale_tuple = preg_split('_', $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 = preg_split('-',$lang);
 		if (count($lang_tuple) > 1) {
 		    $language = strtolower($lang_tuple[0]);
 		    $country = strtoupper($lang_tuple[1]);


Wolfgang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/debian-edu-pkg-team/attachments/20160516/ab7dd8f7/attachment.sig>


More information about the Debian-edu-pkg-team mailing list