File: 1003_php8-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 (17 lines) | stat: -rw-r--r-- 636 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
From: Guido Berhoerster <guido@berhoerster.name>
Subject: Add compatibility with PHP 8
Abstract:
 crypt() reuires a salt in PHP 8.
Forwarded: https://salsa.debian.org/debian-edu/upstream/slbackup-php/-/commit/c2fb434c4983b78972d487cceda331456b3a44a8

--- slbackup-php.orig/src/index.php
+++ slbackup-php/src/index.php
@@ -695,7 +695,7 @@ if (empty ($config)) {
 }
 
 if (empty($encrypt) || empty ($xorstring)) {
-    $encrypt = crypt(strrev(sprintf (gettimeofday (true)))) ;
+    $encrypt = crypt('', strrev(sprintf (gettimeofday (true)))) ;
     $_SESSION['encrypt'] = $encrypt ; 
     $xorstring = xorstring ($encrypt, $passwd) ; 
 }