commit 11b4e65348178a1936eb8f434709da65e0e0ac05
parent a5be5ed5170a830117840f4790eaeeb89cb5db6f
Author: Jan Dankert <devnull@localhost>
Date: Sun, 9 Dec 2018 23:32:58 +0100
Fix: Geshi PHP7-fähig
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/geshi/geshi.php b/geshi/geshi.php
@@ -594,7 +594,7 @@ class GeSHi {
* {@link GeSHi->set_language_path()}
* @since 1.0.0
*/
- function GeSHi($source = '', $language = '', $path = '') {
+ function __construct($source = '', $language = '', $path = '') {
if (!empty($source)) {
$this->set_source($source);
}
@@ -4733,7 +4733,9 @@ class GeSHi {
// TODO: a|bb|c => [ac]|bb
static $callback_2;
if (!isset($callback_2)) {
- $callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";');
+ $callback_2 = function( $matches ) {
+ return "[" . str_replace("|", "", $matches[1]) . "]";
+ };
}
$list = preg_replace_callback('#\(\?\:((?:.\|)+.)\)#', $callback_2, $list);
}
diff --git a/modules/wikiparser/renderer/HtmlRenderer.class.php b/modules/wikiparser/renderer/HtmlRenderer.class.php
@@ -160,7 +160,7 @@ class HtmlRenderer
if ( strtolower(get_class($c)) == 'textelement')
$source .= $c->text."\n";
$child->children = array();
- require_once('./geshi/geshi.php');
+ require_once( __DIR__.'/../../../geshi/geshi.php');
$geshi = new Geshi($source,$child->language);
$val = $geshi->parse_code();
}