diff --git a/plugins/box/snippets/snippets.plugin.php b/plugins/box/snippets/snippets.plugin.php index a242835..14a429e 100644 --- a/plugins/box/snippets/snippets.plugin.php +++ b/plugins/box/snippets/snippets.plugin.php @@ -59,11 +59,16 @@ $snippet_path = STORAGE . DS . 'snippets' . DS . $name . '.snippet.php'; if (File::exists($snippet_path)) { + + // Turn on output buffering ob_start(); + + // Include view file include $snippet_path; - $snippet_contents = ob_get_contents(); - ob_end_clean(); - return $snippet_contents; + + // Output... + return ob_get_clean(); + } else { if (Session::exists('admin') && Session::get('admin') == true) { return __('Snippet :name is not found!', 'snippets', array(':name' => $name));