]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixed possible WSOD for plugin text file page handler.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 27 Apr 2011 21:21:36 +0000 (21:21 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 27 Apr 2011 21:21:36 +0000 (21:21 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@9037 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/admin.php

index 61f64c8b3174cdf5cd0b9e6e2ba1e0f4651da253..5528a29cccca3cea9f577b3ed5dd007f0e9fc26c 100644 (file)
@@ -516,9 +516,11 @@ function admin_markdown_page_handler($pages) {
        $filename = elgg_extract(1, $pages);
 
        $error = false;
-
        if (!$plugin) {
                $error = elgg_echo('admin:plugins:markdown:unknown_plugin');
+               $body = elgg_view_layout('admin', array('content' => $error, 'title' => $error));
+               echo elgg_view_page($title, $body, 'admin');
+               return true;
        }
 
        $text_files = $plugin->getAvailableTextFiles();
@@ -545,7 +547,9 @@ function admin_markdown_page_handler($pages) {
        $text = Markdown($file_contents);
 
        $body = elgg_view_layout('admin', array(
-               'content' => $text,
+               // setting classes here because there's no way to pass classes
+               // to the layout
+               'content' => '<div class="elgg-markdown">' . $text . '</div>',
                'title' => $title
        ));