Skip to content

Commit 84ba095

Browse files
authored
feat(wiki): force lower case domain names on creation (#613)
1 parent ed17991 commit 84ba095

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# api
22

3+
## 8x.13.0 - 22 June 2023
4+
- Force lowercase domain names on wiki creation
5+
36
## 8x.12.4 - 19 June 2023
47
- Reenable work done in polling job
58

app/Http/Controllers/WikiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct( DomainValidator $domainValidator )
3232
public function create(Request $request): \Illuminate\Http\Response
3333
{
3434
$user = $request->user();
35-
$submittedDomain = $request->input('domain');
35+
$submittedDomain = strtolower($request->input('domain'));
3636

3737
$validator = $this->domainValidator->validate( $submittedDomain );
3838
$isSubdomain = $this->isSubDomain($submittedDomain);

tests/Routes/Wiki/CreateTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testWikiCreateDispatchesSomeJobs( $elasticSearchEnabledForNewWik
5151
'POST',
5252
$this->route,
5353
[
54-
'domain' => 'derp.com',
54+
'domain' => 'dErP.com',
5555
'sitename' => 'merp',
5656
'username' => 'AdminBoss'
5757
]
@@ -83,7 +83,6 @@ public function testWikiCreateDispatchesSomeJobs( $elasticSearchEnabledForNewWik
8383
);
8484
}
8585

86-
8786
public function createProvider() {
8887

8988
yield [

0 commit comments

Comments
 (0)