From 7ad0d3f1ffe1d6ec5cf92d5c965484ad561df91b Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Wed, 14 Oct 2026 23:08:34 -0500 Subject: [PATCH 1/2] Accept the starter templates' own work on the install page A template the wiki-templates repository wrote itself, rather than adapted from another wiki, says "Source: phpBB Modders (own work)" instead of a source page. It is accepted like the others; the licence line is still required. Co-Authored-By: Claude Opus 5.5 --- tests/unit/starter_templates_test.php | 7 +++++++ wiki/starter_templates.php | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/unit/starter_templates_test.php b/tests/unit/starter_templates_test.php index 1f5f330..6b4c693 100644 --- a/tests/unit/starter_templates_test.php +++ b/tests/unit/starter_templates_test.php @@ -26,6 +26,13 @@ public function test_an_adapted_template_with_its_header_is_accepted() $this->assertSame('', starter_templates::problem('Small', self::HEADER . '[size=85]{{{1}}}[/size]')); } + public function test_the_repositorys_own_work_is_accepted() + { + $own = "\nSource: phpBB Modders (own work)\nLicence: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/\n== Overview =="; + $this->assertSame('', starter_templates::problem('Start Article', $own)); + $this->assertSame('WIKI_STARTER_NO_ATTRIBUTION', starter_templates::problem('Start Article', str_replace('phpBB Modders (own work)', 'Somebody', $own))); + } + public function test_a_template_without_source_or_licence_is_refused() { $this->assertSame('WIKI_STARTER_NO_ATTRIBUTION', starter_templates::problem('Small', '[size=85]{{{1}}}[/size]')); diff --git a/wiki/starter_templates.php b/wiki/starter_templates.php index 09e010a..6163436 100644 --- a/wiki/starter_templates.php +++ b/wiki/starter_templates.php @@ -283,8 +283,10 @@ public static function problem($name, $text) { return 'WIKI_STARTER_BAD_NAME'; } + // A source page on another wiki, or the repository's own work (a Start template, say), + // and the licence either way if (!preg_match('#\A(.*?)#s', $text, $header) - || !preg_match('#^Source: https://\S+/Template:\S+$#m', $header[1]) + || !preg_match('#^Source: (?:https://\S+/Template:\S+|phpBB Modders \(own work\))$#m', $header[1]) || !preg_match('#^Licence: CC BY-SA 4\.0, https://creativecommons\.org/licenses/by-sa/4\.0/$#m', $header[1])) { return 'WIKI_STARTER_NO_ATTRIBUTION'; From da8b2c141075dc48998a2019d7dbb8d7c9fcd093 Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Wed, 14 Oct 2026 23:09:09 -0500 Subject: [PATCH 2/2] Note the article skeleton in the TODO Co-Authored-By: Claude Opus 5.5 --- docs/TODO.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/TODO.md b/docs/TODO.md index 2858b35..f47eb63 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -8,17 +8,15 @@ Built: when someone creates a new article, a **Start from** choice on the edit p offers every template whose name starts with `Start ` (for example `Template:Start Extension`) and fills the text box with its text. The templates are ordinary wiki pages, so they have versions, approval and permissions, and there is no -separate admin page. See the README. +separate admin page. See the README. An encyclopedia-style skeleton, `Template:Start Article` +(Overview, History, See also, References), comes from the starter templates repository, +[`phpbbmodders/wiki-templates`](https://github.com/phpbbmodders/wiki-templates), and boards +install it from the ACP like the other starter templates. Not built: -- A starter skeleton that comes with the extension (an encyclopedia-style article with - `Overview`, `History` and `References` headings). It would fit the starter templates - repository, [`phpbbmodders/wiki-templates`](https://github.com/phpbbmodders/wiki-templates), - better than code in the extension. - Starting from an existing article, or a template that asks for values first. - ## Categories Built: `[[Category:Name]]` in an article puts it in a category, a category page