- Fixed ndump() source code
This commit is contained in:
parent
b88602a98b
commit
72f5341dff
@ -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),
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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,
|
||||
];
|
||||
|
||||
|
||||
@ -41,10 +41,9 @@ class SourceCodeFormatter {
|
||||
catch(\Throwable $e) {
|
||||
$content = $fileSpl->current();
|
||||
}
|
||||
|
||||
# Get code between <code></code> tags
|
||||
$content = substr($content, strpos($content, "<code>") + 6, strrpos($content, "</code>") - 6);
|
||||
|
||||
|
||||
$content = strip_tags($content, '<span>');
|
||||
|
||||
# Removing the added <?php tag
|
||||
$content = str_replace("<?php", "", $content);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user