diff options
author | Vladimir Druzenko <vvd@FreeBSD.org> | 2023-09-18 12:35:49 +0000 |
---|---|---|
committer | Vladimir Druzenko <vvd@FreeBSD.org> | 2023-09-18 12:47:04 +0000 |
commit | fc4ebc143c4b097ec1ea90fa6831a3125c8619de (patch) | |
tree | 9e22f18b47099411ae355f9634ee49646ee47b64 | |
parent | fb1910b72a4553face1689b4453f041f65e3e93a (diff) | |
download | ports-fc4ebc143c4b097ec1ea90fa6831a3125c8619de.tar.gz ports-fc4ebc143c4b097ec1ea90fa6831a3125c8619de.zip |
www/phpvirtualbox{,-legacy}: PHP 8 support (1 more catch) - "preg_replace"
Fixed:
PHP Warning: preg_replace() expects at least 3 parameters, 2 given in endpoints/screen.php on line 91
PR: 261498
Approved by: tcberner (mentor)
MFH: 2023Q3
(cherry picked from commit 3f1b38acfda124fc8f03fe5f4edfef10ef214501)
-rw-r--r-- | www/phpvirtualbox-legacy/Makefile | 2 | ||||
-rw-r--r-- | www/phpvirtualbox/Makefile | 2 | ||||
-rw-r--r-- | www/phpvirtualbox/files/patch-php8 | 28 |
3 files changed, 27 insertions, 5 deletions
diff --git a/www/phpvirtualbox-legacy/Makefile b/www/phpvirtualbox-legacy/Makefile index 38709462e376..ba80ba721ec8 100644 --- a/www/phpvirtualbox-legacy/Makefile +++ b/www/phpvirtualbox-legacy/Makefile @@ -1,6 +1,6 @@ PORTNAME= phpvirtualbox DISTVERSION= 5.2-1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= www PKGNAMESUFFIX= -legacy diff --git a/www/phpvirtualbox/Makefile b/www/phpvirtualbox/Makefile index 4c4929542c6f..cc67954d33a0 100644 --- a/www/phpvirtualbox/Makefile +++ b/www/phpvirtualbox/Makefile @@ -1,6 +1,6 @@ PORTNAME= phpvirtualbox DISTVERSION= 6.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MAINTAINER= vbox@FreeBSD.org diff --git a/www/phpvirtualbox/files/patch-php8 b/www/phpvirtualbox/files/patch-php8 index d6566684b8ca..477a1596ba4c 100644 --- a/www/phpvirtualbox/files/patch-php8 +++ b/www/phpvirtualbox/files/patch-php8 @@ -144,12 +144,34 @@ diff -ur endpoints/screen.php.orig endpoints/screen.php // Let the browser cache images for 3 seconds $ctime = 0; - if(strpos($_SERVER['HTTP_IF_NONE_MATCH'],'_')) { -+ if(strpos($_SERVER['HTTP_IF_NONE_MATCH'] ?? '','_')) { - $ctime = preg_replace("/.*_/",str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH'])); +- $ctime = preg_replace("/.*_/",str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH'])); - } else if(strpos($_ENV['HTTP_IF_NONE_MATCH'],'_')) { +- $ctime = preg_replace("/.*_/",str_replace('"','',$_ENV['HTTP_IF_NONE_MATCH'])); +- } else if(strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'],'GMT')) { ++ if(strpos($_SERVER['HTTP_IF_NONE_MATCH'] ?? '','_')) { ++ $ctime = preg_replace("/.*_/","",str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH'])); + } else if(strpos($_ENV['HTTP_IF_NONE_MATCH'] ?? '','_')) { - $ctime = preg_replace("/.*_/",str_replace('"','',$_ENV['HTTP_IF_NONE_MATCH'])); ++ $ctime = preg_replace("/.*_/","",str_replace('"','',$_ENV['HTTP_IF_NONE_MATCH'])); ++ } else if(strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'] ?? '','GMT')) { + $ctime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']); +- } else if(strpos($_ENV['HTTP_IF_MODIFIED_SINCE'],'GMT')) { ++ } else if(strpos($_ENV['HTTP_IF_MODIFIED_SINCE'] ?? '','GMT')) { + $ctime = strtotime($_ENV['HTTP_IF_MODIFIED_SINCE']); + } + +@@ -164,13 +164,13 @@ + + // Let the browser cache saved state images + $ctime = 0; +- if(strpos($_SERVER['HTTP_IF_NONE_MATCH'],'_')) { +- $ctime = preg_replace("/.*_/",str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH'])); +- } else if(strpos($_ENV['HTTP_IF_NONE_MATCH'],'_')) { +- $ctime = preg_replace("/.*_/",str_replace('"','',$_ENV['HTTP_IF_NONE_MATCH'])); - } else if(strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'],'GMT')) { ++ if(strpos($_SERVER['HTTP_IF_NONE_MATCH'] ?? '','_')) { ++ $ctime = preg_replace("/.*_/","",str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH'])); ++ } else if(strpos($_ENV['HTTP_IF_NONE_MATCH'] ?? '','_')) { ++ $ctime = preg_replace("/.*_/","",str_replace('"','',$_ENV['HTTP_IF_NONE_MATCH'])); + } else if(strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'] ?? '','GMT')) { $ctime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']); - } else if(strpos($_ENV['HTTP_IF_MODIFIED_SINCE'],'GMT')) { |