From 2ff3dfd1ee54a9dfd54537d1156ffc663255b533 Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Tue, 19 Nov 2024 20:39:21 +0200 Subject: [PATCH 1/5] Prevent warnings when running on CLI --- ARC2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ARC2.php b/ARC2.php index 5a8d371..0688d01 100644 --- a/ARC2.php +++ b/ARC2.php @@ -46,7 +46,7 @@ public static function getIncPath($f = '') public static function getScriptURI() { if (isset($_SERVER) && (isset($_SERVER['SERVER_NAME']) || isset($_SERVER['HTTP_HOST']))) { - $proto = preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'])); + $proto = preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http')); $port = $_SERVER['SERVER_PORT']; $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; $script = $_SERVER['SCRIPT_NAME']; @@ -67,7 +67,7 @@ public static function getScriptURI() public static function getRequestURI() { if (isset($_SERVER) && isset($_SERVER['REQUEST_URI'])) { - return preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'])). + return preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http')). '://'.(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']). (80 != $_SERVER['SERVER_PORT'] ? ':'.$_SERVER['SERVER_PORT'] : ''). $_SERVER['REQUEST_URI']; From fda3415b4c8851a7ab60fbe07aff24bf8cd374a9 Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Wed, 20 Nov 2024 09:21:50 +0200 Subject: [PATCH 2/5] Just try to avoid PHP CS false positive --- ARC2.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ARC2.php b/ARC2.php index 0688d01..14269be 100644 --- a/ARC2.php +++ b/ARC2.php @@ -46,7 +46,8 @@ public static function getIncPath($f = '') public static function getScriptURI() { if (isset($_SERVER) && (isset($_SERVER['SERVER_NAME']) || isset($_SERVER['HTTP_HOST']))) { - $proto = preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http')); + $server_proto = strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http'); + $proto = preg_replace('/^([a-z]+)\/.*$/', '\\1', $server_proto); $port = $_SERVER['SERVER_PORT']; $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; $script = $_SERVER['SCRIPT_NAME']; @@ -67,7 +68,8 @@ public static function getScriptURI() public static function getRequestURI() { if (isset($_SERVER) && isset($_SERVER['REQUEST_URI'])) { - return preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http')). + $server_proto = strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http'); + return preg_replace('/^([a-z]+)\/.*$/', '\\1', $server_proto). '://'.(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']). (80 != $_SERVER['SERVER_PORT'] ? ':'.$_SERVER['SERVER_PORT'] : ''). $_SERVER['REQUEST_URI']; From 979bc342d1f0072f91b5bada7a53cf307cc15e88 Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Wed, 20 Nov 2024 09:37:18 +0200 Subject: [PATCH 3/5] Fix unrelated coding standards violation --- store/ARC2_StoreLoadQueryHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/ARC2_StoreLoadQueryHandler.php b/store/ARC2_StoreLoadQueryHandler.php index e25fb8b..82d46ca 100644 --- a/store/ARC2_StoreLoadQueryHandler.php +++ b/store/ARC2_StoreLoadQueryHandler.php @@ -490,7 +490,7 @@ public function bufferIDSQL($tbl, $id, $val, $val_type) public function checkSQLBuffers( $force_write = 0, $reset_id_buffers = 0, - $refresh_lock = 0 + $refresh_lock = 0, ) { if (!$this->keep_time_limit) { set_time_limit($this->v('time_limit', 60, $this->a)); From 417edec6e22ab5b63e12575101c035ea2584b04e Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Wed, 20 Nov 2024 09:40:19 +0200 Subject: [PATCH 4/5] Revert fda3415b (it was something different) --- ARC2.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ARC2.php b/ARC2.php index 14269be..0688d01 100644 --- a/ARC2.php +++ b/ARC2.php @@ -46,8 +46,7 @@ public static function getIncPath($f = '') public static function getScriptURI() { if (isset($_SERVER) && (isset($_SERVER['SERVER_NAME']) || isset($_SERVER['HTTP_HOST']))) { - $server_proto = strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http'); - $proto = preg_replace('/^([a-z]+)\/.*$/', '\\1', $server_proto); + $proto = preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http')); $port = $_SERVER['SERVER_PORT']; $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; $script = $_SERVER['SCRIPT_NAME']; @@ -68,8 +67,7 @@ public static function getScriptURI() public static function getRequestURI() { if (isset($_SERVER) && isset($_SERVER['REQUEST_URI'])) { - $server_proto = strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http'); - return preg_replace('/^([a-z]+)\/.*$/', '\\1', $server_proto). + return preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http')). '://'.(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']). (80 != $_SERVER['SERVER_PORT'] ? ':'.$_SERVER['SERVER_PORT'] : ''). $_SERVER['REQUEST_URI']; From b2267eb04071d73acc27a0c5d7d38931b933f4bc Mon Sep 17 00:00:00 2001 From: Konrad Abicht Date: Fri, 22 Nov 2024 08:38:48 +0100 Subject: [PATCH 5/5] Update ARC2_StoreLoadQueryHandler.php --- store/ARC2_StoreLoadQueryHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/ARC2_StoreLoadQueryHandler.php b/store/ARC2_StoreLoadQueryHandler.php index 82d46ca..e25fb8b 100644 --- a/store/ARC2_StoreLoadQueryHandler.php +++ b/store/ARC2_StoreLoadQueryHandler.php @@ -490,7 +490,7 @@ public function bufferIDSQL($tbl, $id, $val, $val_type) public function checkSQLBuffers( $force_write = 0, $reset_id_buffers = 0, - $refresh_lock = 0, + $refresh_lock = 0 ) { if (!$this->keep_time_limit) { set_time_limit($this->v('time_limit', 60, $this->a));