- Fixed ndump() source code

This commit is contained in:
Dave Mc Nicoll 2026-05-22 18:49:22 +00:00
parent b88602a98b
commit 72f5341dff
4 changed files with 6 additions and 10 deletions

View File

@ -5,7 +5,7 @@ use function DI\autowire, DI\create, DI\get;
use Negundo\Client\{ SoftwareConfig, Dump, Task, NegundoMiddleware }; use Negundo\Client\{ SoftwareConfig, Dump, Task, NegundoMiddleware };
return [ 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), NegundoMiddleware::class => autowire(NegundoMiddleware::class),
Dump::class => autowire(Dump::class), Dump::class => autowire(Dump::class),
Task::class => autowire(Task::class), Task::class => autowire(Task::class),

View File

@ -39,10 +39,7 @@ class Curl implements TransportInterface {
throw new \Exception(sprintf("HTTP code received : $code with page content : %s", $exec)); throw new \Exception(sprintf("HTTP code received : $code with page content : %s", $exec));
} }
} }
if ($_GET['dev'] ?? false) {
echo($exec);
die();
}
curl_close($ch); curl_close($ch);
return $exec; return $exec;

View File

@ -20,7 +20,7 @@ class ExceptionHandler {
'HTTP_HOST' => $serverData['HTTP_HOST'] ?? "", 'HTTP_HOST' => $serverData['HTTP_HOST'] ?? "",
'REQUEST_URI' => $serverData['REQUEST_URI'] ?? "", 'REQUEST_URI' => $serverData['REQUEST_URI'] ?? "",
'HTTP_USER_AGENT' => $serverData['HTTP_USER_AGENT'] ?? "# UNKNOWN #", '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, 'REQUEST_METHOD' => $serverData['HTTP_X_HTTP_METHOD'] ?? $serverData['REQUEST_METHOD'] ?? null,
]; ];

View File

@ -41,10 +41,9 @@ class SourceCodeFormatter {
catch(\Throwable $e) { catch(\Throwable $e) {
$content = $fileSpl->current(); $content = $fileSpl->current();
} }
# Get code between <code></code> tags $content = strip_tags($content, '<span>');
$content = substr($content, strpos($content, "<code>") + 6, strrpos($content, "</code>") - 6);
# Removing the added <?php tag # Removing the added <?php tag
$content = str_replace("&lt;?php", "", $content); $content = str_replace("&lt;?php", "", $content);