Author: Derick Rethans (derickr) Date: 2024-08-20T10:42:48+01:00 Commit: https://github.com/php/web-wiki/commit/5ccdaa2a324e7070873b34abd201a3a4c06c74cd Raw diff: https://github.com/php/web-wiki/commit/5ccdaa2a324e7070873b34abd201a3a4c06c74cd.diff
Upgrade to 2024-02-06b "Kaos" Changed paths: M dokuwiki/VERSION M dokuwiki/data/media/wiki/dokuwiki-128.png M dokuwiki/doku.php M dokuwiki/inc/Action/Export.php M dokuwiki/inc/parser/metadata.php M dokuwiki/lib/plugins/authplain/_test/escaping.test.php M dokuwiki/lib/plugins/config/_test/WriterTest.php Diff: diff --git a/dokuwiki/VERSION b/dokuwiki/VERSION index 8dc881a9..a4469a46 100644 --- a/dokuwiki/VERSION +++ b/dokuwiki/VERSION @@ -1 +1 @@ -2024-02-06a "Kaos" +2024-02-06b "Kaos" diff --git a/dokuwiki/data/media/wiki/dokuwiki-128.png b/dokuwiki/data/media/wiki/dokuwiki-128.png index b2306ac9..f3f1d66b 100644 Binary files a/dokuwiki/data/media/wiki/dokuwiki-128.png and b/dokuwiki/data/media/wiki/dokuwiki-128.png differ diff --git a/dokuwiki/doku.php b/dokuwiki/doku.php index 4d17a3cb..08bae770 100644 --- a/dokuwiki/doku.php +++ b/dokuwiki/doku.php @@ -13,7 +13,7 @@ use dokuwiki\Extension\Event; // update message version - always use a string to avoid localized floats! -$updateVersion = "55.1"; +$updateVersion = "55.2"; // xdebug_start_profiling(); diff --git a/dokuwiki/inc/Action/Export.php b/dokuwiki/inc/Action/Export.php index 61458e29..68f2358d 100644 --- a/dokuwiki/inc/Action/Export.php +++ b/dokuwiki/inc/Action/Export.php @@ -86,6 +86,9 @@ public function preProcess() $headers['Content-Type'] = 'text/html; charset=utf-8'; $output = p_wiki_xhtml($ID, $REV, false); break; + case 'metadata': + // metadata should not be exported + break; default: $output = p_cached_output(wikiFN($ID, $REV), $mode, $ID); $headers = p_get_metadata($ID, "format $mode"); diff --git a/dokuwiki/inc/parser/metadata.php b/dokuwiki/inc/parser/metadata.php index 2d84f506..3ba576eb 100644 --- a/dokuwiki/inc/parser/metadata.php +++ b/dokuwiki/inc/parser/metadata.php @@ -108,6 +108,8 @@ public function document_end() if (!isset($this->meta['date']['modified'])) { $this->meta['date']['modified'] = filemtime(wikiFN($ID)); } + + $this->doc = ''; } /** diff --git a/dokuwiki/lib/plugins/authplain/_test/escaping.test.php b/dokuwiki/lib/plugins/authplain/_test/escaping.test.php index 7790d930..111a2417 100644 --- a/dokuwiki/lib/plugins/authplain/_test/escaping.test.php +++ b/dokuwiki/lib/plugins/authplain/_test/escaping.test.php @@ -15,13 +15,13 @@ */ class helper_plugin_authplain_escaping_test extends DokuWikiTest { - protected $pluginsEnabled = array('authplainharness'); - /** @var auth_plugin_authplain|auth_plugin_authplainharness */ + protected $pluginsEnabled = array('authplain'); + /** @var auth_plugin_authplain */ protected $auth; protected function reloadUsers() { /* auth caches data loaded from file, but recreated object forces reload */ - $this->auth = new auth_plugin_authplainharness(); + $this->auth = new auth_plugin_authplain(); } function setUp() : void { @@ -66,6 +66,14 @@ public function testNameWithBackslashes() { $this->assertEquals($name,$user['name']); } + public function testNameWithHash() { + $name = "Hash # User"; + $this->auth->createUser("slashuser", "password", $name, "m...@example.com"); + $this->reloadUsers(); + $user = $this->auth->getUserData("slashuser"); + $this->assertEquals($name,$user['name']); + } + public function testModifyUser() { global $conf; $conf['passcrypt'] = 'mediawiki'; @@ -83,8 +91,6 @@ public function testModifyUser() { // really only required for developers to ensure this plugin will // work with systems running on PCRE 6.6 and lower. public function testLineSplit(){ - $this->auth->setPregsplit_safe(false); - $names = array( 'plain', 'ut-fठ8', @@ -98,7 +104,7 @@ public function testLineSplit(){ foreach ($names as $testname) { $escaped = str_replace(array('\\',':'),array('\\\\','\\:'),$testname); // escape : & \ $test_line = $userpass.$escaped.$other_user_data; - $result = $this->auth->splitUserData($test_line); + $result = $this->callInaccessibleMethod($this->auth, 'splitUserData', [$test_line]); $this->assertEquals($escaped, $result[2]); } @@ -129,31 +135,3 @@ public function testCleaning($input, $expected) $this->assertEquals($expected, $this->auth->cleanGroup($input)); } } - -/** - * Class auth_plugin_authplainharness - */ -class auth_plugin_authplainharness extends auth_plugin_authplain { - - /** - * @param boolean $bool - */ - public function setPregsplit_safe($bool) { - $this->pregsplit_safe = $bool; - } - - /** - * @return bool|mixed - */ - public function getPregsplit_safe(){ - return $this->pregsplit_safe; - } - - /** - * @param string $line - * @return array - */ - public function splitUserData($line){ - return parent::splitUserData($line); - } -} diff --git a/dokuwiki/lib/plugins/config/_test/WriterTest.php b/dokuwiki/lib/plugins/config/_test/WriterTest.php index 739f68be..391cbbdb 100644 --- a/dokuwiki/lib/plugins/config/_test/WriterTest.php +++ b/dokuwiki/lib/plugins/config/_test/WriterTest.php @@ -60,4 +60,11 @@ public function testTouch() { clearstatcache($config); $this->assertGreaterThan($old, filemtime($config)); } + + public function testEmpty() { + $writer = new Writer(); + $this->expectException(\Exception::class); + $this->expectErrorMessage('empty config'); + $writer->save([]); + } }