diff --git a/app/Core/Container.php b/app/Core/Container.php index f005e37..ff748b1 100644 --- a/app/Core/Container.php +++ b/app/Core/Container.php @@ -38,20 +38,21 @@ class Container implements ContainerInterface return $this->instances[$id]; } - if (!$this->has($id)) { - return $this->resolve($id); + if (isset($this->bindings[$id])) { + $binding = $this->bindings[$id]; + $concrete = $binding['concrete']; + + $object = $this->resolve($concrete); + + if ($binding['singleton']) { + $this->instances[$id] = $object; + } + + return $object; } - $binding = $this->bindings[$id]; - $concrete = $binding['concrete']; - - $object = $this->resolve($concrete); - - if ($binding['singleton']) { - $this->instances[$id] = $object; - } - - return $object; + // Not bound, auto-resolve using Reflection + return $this->resolve($id); } /** diff --git a/resources/views/errors/500.php b/resources/views/errors/500.php index a2cb747..4a06819 100644 --- a/resources/views/errors/500.php +++ b/resources/views/errors/500.php @@ -10,15 +10,15 @@
= isset($message) ? $this->escape($message) : 'A critical exception has occurred on the application server.' ?>
+= isset($message) ? htmlspecialchars($message, ENT_QUOTES, 'UTF-8') : 'A critical exception has occurred on the application server.' ?>
-= $this->escape($exception->getMessage()) ?>
-in = $this->escape($exception->getFile()) ?>:= $exception->getLine() ?>
+= htmlspecialchars($exception->getMessage(), ENT_QUOTES, 'UTF-8') ?>
+in = htmlspecialchars($exception->getFile(), ENT_QUOTES, 'UTF-8') ?>:= $exception->getLine() ?>
-= $this->escape($exception->getTraceAsString()) ?>
+= htmlspecialchars($exception->getTraceAsString(), ENT_QUOTES, 'UTF-8') ?>
Return Home