Skip to content

Commit

Permalink
Update LegacyController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
inmanturbo authored Jul 12, 2021
1 parent 4b476d5 commit 0c4bb92
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Http/Controllers/LegacyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@ public function __invoke(Request $request, $file)

$file = base_path(config('legacy-loader.file_path') . $this->getCleanPath($request->path()));

if (! str_contains($request->path(), '.php')) {
if (!str_contains($request->path(), '.php')) {
$file = str_replace(['.html', '.php', '.txt'], '', $file) . '.php';
}
if (file_exists($file)) {
// ob_start();
require_once($file);

// return new Response(ob_get_clean());
}
} else {

/**
* Todo: Exceptions
*/
abort(404);
/**
* Todo: Exceptions
*/
abort(404);
}
}

protected function getCleanPath(string $path)
Expand Down

0 comments on commit 0c4bb92

Please sign in to comment.