diff --git a/mod/wiki/parser/parser.php b/mod/wiki/parser/parser.php index 9616e3b19f5..4fefa00b442 100644 --- a/mod/wiki/parser/parser.php +++ b/mod/wiki/parser/parser.php @@ -38,17 +38,17 @@ class wiki_parser_proxy { return false; } } - + public static function get_section(&$string, $type, $section, $all_content = false) { if(self::create_parser_instance($type)) { $content = self::$parsers[$type]->get_section($section, $string, true); - + if($all_content) { - return $content; + return $content; } else { - return is_array($content) ? $content[1] : null; - } + return is_array($content) ? $content[1] : null; + } } else { return false; @@ -84,17 +84,17 @@ abstract class generic_parser { private $rulestack = array(); protected $parser_status = 'Before'; - + /** * Dynamic return values */ - + protected $returnvalues = array(); private $nowikiindex = array(); protected $nowikitoken = "%!"; - + public function __construct() {} /** @@ -115,7 +115,7 @@ abstract class generic_parser { if(method_exists($this, 'before_parsing')) { $this->before_parsing(); } - + $this->parser_status = 'Parsing'; foreach($this->blockrules as $name => $block) { @@ -129,7 +129,7 @@ abstract class generic_parser { if(method_exists($this, 'after_parsing')) { $this->after_parsing(); } - + return array('parsed_text' => $this->string) + $this->returnvalues; } @@ -220,7 +220,7 @@ abstract class generic_parser { else { $replace = parser_utils::h($rule['tag'], "$1"); } - + $text = preg_replace($rule['expression'], $replace, $text); } } @@ -277,5 +277,5 @@ abstract class generic_parser { } return false; - } + } }