diff --git a/meta/negundo.php b/meta/negundo.php index 3401146..ebc6d60 100644 --- a/meta/negundo.php +++ b/meta/negundo.php @@ -5,7 +5,7 @@ use function DI\autowire, DI\create, DI\get; use Negundo\Client\{ SoftwareConfig, Dump, Task, NegundoMiddleware }; return [ - SoftwareConfig::class => create(SoftwareConfig::class)->constructor(getenv('NEGUNDO_HASH'), getenv('NEGUNDO_SERVER')), + SoftwareConfig::class => create(SoftwareConfig::class)->constructor(getenvonce('NEGUNDO_HASH'), getenvonce('NEGUNDO_SERVER')), NegundoMiddleware::class => autowire(NegundoMiddleware::class), Dump::class => autowire(Dump::class), Task::class => autowire(Task::class), diff --git a/src/Transport/Curl.php b/src/Transport/Curl.php index 1f59aea..bcbe64f 100644 --- a/src/Transport/Curl.php +++ b/src/Transport/Curl.php @@ -39,10 +39,7 @@ class Curl implements TransportInterface { throw new \Exception(sprintf("HTTP code received : $code with page content : %s", $exec)); } } - if ($_GET['dev'] ?? false) { - echo($exec); - die(); - } + curl_close($ch); return $exec; diff --git a/src/Util/ExceptionHandler.php b/src/Util/ExceptionHandler.php index 3a39cee..f570a3e 100644 --- a/src/Util/ExceptionHandler.php +++ b/src/Util/ExceptionHandler.php @@ -20,7 +20,7 @@ class ExceptionHandler { 'HTTP_HOST' => $serverData['HTTP_HOST'] ?? "", 'REQUEST_URI' => $serverData['REQUEST_URI'] ?? "", 'HTTP_USER_AGENT' => $serverData['HTTP_USER_AGENT'] ?? "# UNKNOWN #", - 'REMOTE_ADDR' => $serverData['REMOTE_ADDR'] ?? null, + 'REMOTE_ADDR' => $server['HTTP_X_FORWARDED_FOR'] ?? $serverData['REMOTE_ADDR'] ?? null, 'REQUEST_METHOD' => $serverData['HTTP_X_HTTP_METHOD'] ?? $serverData['REQUEST_METHOD'] ?? null, ]; diff --git a/src/Util/SourceCodeFormatter.php b/src/Util/SourceCodeFormatter.php index 07e66b1..d12d227 100644 --- a/src/Util/SourceCodeFormatter.php +++ b/src/Util/SourceCodeFormatter.php @@ -41,10 +41,9 @@ class SourceCodeFormatter { catch(\Throwable $e) { $content = $fileSpl->current(); } - - # Get code between tags - $content = substr($content, strpos($content, "") + 6, strrpos($content, "") - 6); - + + $content = strip_tags($content, ''); + # Removing the added