diff options
-rw-r--r-- | Zotlabs/Module/Help.php | 5 | ||||
-rw-r--r-- | tests/unit/Module/HelpTest.php | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Zotlabs/Module/Help.php b/Zotlabs/Module/Help.php index fd5cacee6..4adf95692 100644 --- a/Zotlabs/Module/Help.php +++ b/Zotlabs/Module/Help.php @@ -6,6 +6,7 @@ use Michelf\MarkdownExtra; /** * You can create local site resources in doc/Site.md and either link to doc/Home.md for the standard resources * or use our include mechanism to include it on your local page. + * *@code * #include doc/Home.md; *@endcode @@ -160,6 +161,10 @@ class Help extends \Zotlabs\Web\Controller { array_shift($args); } + if (empty($args)) { + goaway("/help/{$this->lang['language']}/about/about"); + } + // Keep the first remaining arg as the heading slug $this->heading_slug = $args[0]; diff --git a/tests/unit/Module/HelpTest.php b/tests/unit/Module/HelpTest.php index c345d5e52..353a40def 100644 --- a/tests/unit/Module/HelpTest.php +++ b/tests/unit/Module/HelpTest.php @@ -104,6 +104,11 @@ class HelpTest extends \Zotlabs\Tests\Unit\Module\TestCase { $this->get('help'); } + public function test_getting_locale_with_no_topic_should_redirect_to_about_page_for_locale(): void { + $this->expectRedirectTo('help/de/about/about'); + $this->get('help/de'); + } + public function test_find_help_file_returns_first_match(): void { // Stub file exists, to always return true $fe_stub = $this->getFunctionMock('Zotlabs\Lib\Traits', 'file_exists'); |