1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00

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
This commit is contained in:
Vladimir Druzenko 2023-09-18 15:35:49 +03:00
parent 49080d9600
commit 3f1b38acfd
3 changed files with 28 additions and 6 deletions

View File

@ -1,6 +1,6 @@
PORTNAME= phpvirtualbox
DISTVERSION= 5.2-1
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= www
PKGNAMESUFFIX= -legacy

View File

@ -1,6 +1,6 @@
PORTNAME= phpvirtualbox
DISTVERSION= 6.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= www
MAINTAINER= vbox@FreeBSD.org

View File

@ -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'],'_')) {
+ } 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')) {
+ 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')) {
+ } 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')) {