diff --git a/plugin.info.txt b/plugin.info.txt index f89c1e5..5635d27 100644 --- a/plugin.info.txt +++ b/plugin.info.txt @@ -1,7 +1,7 @@ base sqlquery author George Pirogov email i1557@yandex.ru -date 2018-12-10 -name SQL query plugin +date 2018-12-12 +name SQL query plugin (multidb) desc Processing query to mysql database and display results as a table. url https://www.dokuwiki.org/plugin:sqlquery diff --git a/syntax.php b/syntax.php index 7bc0c75..8c415e9 100644 --- a/syntax.php +++ b/syntax.php @@ -85,7 +85,7 @@ class syntax_plugin_sqlquery extends DokuWiki_Syntax_Plugin { $password = $this->getConf('password'); // connect to database - $dsn = "{$data['type']}:host={$data['host']};dbname={$data[db]}"; + $dsn = "{$data['type']}:host={$data['host']};dbname={$data[db]};charset=UTF-8;"; try { $dbh = new PDO($dsn, $user, $password); } catch (PDOException $e) { @@ -126,7 +126,7 @@ class syntax_plugin_sqlquery extends DokuWiki_Syntax_Plugin { $renderer->doc .= ""; for ( $i = 0; $i < $fieldcount; $i++ ) { $renderer->doc .= ""; - $renderer->doc .= $row[$i]; + $renderer->doc .= htmlentities($row[$i]); $renderer->doc .= ""; } $renderer->doc .= "\n";