Skip to content

Commit

Permalink
Display an error message if the include plugin could not be loaded.
Browse files Browse the repository at this point in the history
This prevents a crash/blank page if the include plugin is not installed or disabled.
  • Loading branch information
lpaulsen93 committed Feb 18, 2018
1 parent e7146ae commit 1b2535e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lang/de/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
// custom language strings for the plugin
$lang['readmore'] = '→ Weiter lesen...';
$lang['nopagemsg'] = 'randominc: keine Seite gefunden.';
$lang['plugin_include_failure'] = 'randominc: das include Plugin konnte nicht geladen werden. Bitte aktivieren oder installieren Sie das include Plugin.';

//Setup VIM: ex: et ts=2 enc=utf-8 :
1 change: 1 addition & 0 deletions lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
// custom language strings for the plugin
$lang['readmore'] = '→ Read more...';
$lang['nopagemsg'] = 'randominc: no page found.';
$lang['plugin_include_failure'] = 'randominc: could not load include plugin. Please install or enable the include plugin.';

//Setup VIM: ex: et ts=2 enc=utf-8 :
7 changes: 7 additions & 0 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,14 @@ function render($format, Doku_Renderer $renderer, $data) {
$this->getFlags($flags, $flagsarray);

if (!$this->helper)
{
$this->helper = plugin_load('helper', 'include');
if (!$this->helper)
{
msg($this->getLang('plugin_include_failure'), -1);
return true;
}
}
$flags = $this->helper->get_flags($flags);

$pages = $this->helper->_get_included_pages($mode, $page, $sect, $parent_id, $flags);
Expand Down

0 comments on commit 1b2535e

Please sign in to comment.