rattkin / syntaxmantis

Dokuwiki plugin for Mantis-BT links
0 stars 0 forks source link

Undefined variable $url in syntaxmantis/syntax.php #2

Open fpaquet opened 5 months ago

fpaquet commented 5 months ago

Since latest update of DokuWiki Release 2024-02-06a "Kaos" we get PHP error messages when opening the page preview while editing some page contents.

Ma│2024/03/04 13:49:41 [error] 978#978: *14195 FastCGI sent in stderr: "PHP message: PHP Warning:  Undefined variable $conf in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 43; PHP message: PHP Warning:  Trying to access array offset│
Ma│ on value of type null in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 43; PHP message: PHP Warning:  Trying to access array offset on value of type null in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 43; P│
Ma│HP message: PHP Warning:  Undefined variable $url in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 51; PHP message: PHP Warning:  Undefined variable $conf in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 43; P│
Ma│HP message: PHP Warning:  Trying to access array offset on value of type null in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 43; PHP message: PHP Warning:  Trying to access array offset on value of type null in /var/www/html/dok│
Ma│uwiki/lib/plugins/syntaxmantis/syntax.php on line 43; PHP message: PHP Warning:  Undefined variable $url in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 51; PHP message: PHP Warning:  Undefined variable $conf in /var/www/html/dok│
Ma│uwiki/lib/plugins/syntaxmantis/syntax.php on line 43; PHP message: PHP Warning:  Trying to access array offset on value of type null in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 43; PHP message: PHP Warning:  Trying to access │
Ma│array offset on value of type null in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 43; PHP message: PHP Warning:  Undefined variable $url in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 51; PHP message: PHP │
Ma│Warning:  Undefined variable $conf in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php on line 43; PHP message: PHP Warning:  Trying to access array offset on value of type null in /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php o│
Ma│n line 43; PHP message: PHP Warning:  T 

Environment:

Steps to reproduce:

fpaquet commented 5 months ago

Digging into the code, we created the following patch, which solves the issue for us:

File /var/www/html/dokuwiki/lib/plugins/syntaxmantis/syntax.php saved

[root@madness:/var/www/html/dokuwiki/lib/plugins/syntaxmantis] git diff syntax.php
diff --git a/lib/plugins/syntaxmantis/syntax.php b/lib/plugins/syntaxmantis/synt
index 971b642..cc3aa53 100644
--- a/lib/plugins/syntaxmantis/syntax.php
+++ b/lib/plugins/syntaxmantis/syntax.php
@@ -38,7 +38,10 @@ class syntax_plugin_syntaxmantis extends DokuWiki_Syntax_Plug

     function render($mode, Doku_Renderer $renderer, $data) {
         if($mode == 'xhtml'){
-               $link['target'] = $conf['target']['wiki'];
+        //local $link;
+        global $conf;
+        global $url;
+       //      $link['target'] = $conf['target']['wiki'];
                $link['style']  = '';
                $link['pre']    = '';
                $link['suf']    = '';