Commit 27502918 authored by Taylor Otwell's avatar Taylor Otwell

fix bundle dependency error possibility. fix WSOD in view rendering.

parent 67696d81
......@@ -46,7 +46,7 @@ class Bundle {
// dependent bundles so that they are available.
if (file_exists($path = static::path($bundle).'bundle'.EXT))
{
require $path;
require_once $path;
}
// Each bundle may also have a "routes" file which is responsible for
......@@ -65,11 +65,9 @@ class Bundle {
*/
public static function routes($bundle)
{
if (static::started($bundle)) return;
if (file_exists($path = static::path($bundle).'routes'.EXT))
{
require $path;
require_once $path;
}
}
......
......@@ -214,7 +214,16 @@ class Response {
// Since this method is used by both the Route and Controller classes, it is
// a convenient spot to cast the application response to a string before it
// is returned to the main request handler.
$response->content = (string) $response->content;
$content =& $response->content;
if (is_object($content) and method_exists($content, '__toString'))
{
$content = $content->__toString();
}
else
{
$content = (string) $content;
}
return $response;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment