Index: branches/RC/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r10780 -r10796 --- branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 10780) +++ branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 10796) @@ -411,6 +411,32 @@ } /** + * Shows not found template content + * + * @param kEvent $event + * + */ + function _errorNotFound(&$event) + { + if ($event->getEventParam('raise_warnings') === 0) { + // when it's possible, that autoload fails do nothing + return ; + } + + header('HTTP/1.0 404 Not Found'); + + while (ob_get_level()) { + ob_end_clean(); + } + + // object is used inside template parsing, so break out any parsing and return error document + $error_template = $this->Application->ConfigValue('ErrorTemplate'); + $this->Application->HTML = $this->Application->ParseBlock( Array ('name' => $error_template) ); + $this->Application->Done(); + exit; + } + + /** * Builds item (loads if needed) * * @param kEvent $event