Skip to content

Commit

Permalink
Just try to avoid PHP CS false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea authored Nov 20, 2024
1 parent 2ff3dfd commit fda3415
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ARC2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -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'];
Expand Down

0 comments on commit fda3415

Please sign in to comment.