Bug Report #1273

View->render doesn't handle exceptions gracefully

Added by Colin Mollenhour almost 3 years ago. Updated over 2 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:Sam de Freyssinet % Done:

100%

Category:Libraries
Target version:2.3.3
Resolution: Points:

Description

The problem really lies within Controller->_kohana_load_view. If the view throws an exception, the output buffer is not properly closed so the output echoed before the exception can get flushed which may not be desired (e.g. if you are rendering an XML RPC with sensitive information). This patch simply wraps the include in a try/catch and closes the buffer if an exception is thrown and then rethrows the exception.

kohana_load_view_exception.diff (613 Bytes) Colin Mollenhour, 04/20/2009 02:49 am

0001-Always-clear-output-buffer-of-Controller-_kohana_lo.patch - Coding Style (921 Bytes) Chris Bandy, 05/14/2009 08:47 am

Associated revisions

Revision 4365
Added by Sam de Freyssinet over 2 years ago

Fixes #1273. Wraps the include statement in try catch, catch cleans the output buffer and then re-throws the error

History

Updated by Chris Bandy over 2 years ago

Agreed. The output buffer must be cleaned up when leaving this function.

Updated by Sam de Freyssinet over 2 years ago

  • Status changed from New to Assigned
  • Assignee set to Sam de Freyssinet

Updated by Sam de Freyssinet over 2 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset r4365.

Also available in: Atom PDF