feat(wiki): force lower case domain names on creation#613
Conversation
| $this->route, | ||
| [ | ||
| 'domain' => 'derp.com', | ||
| 'domain' => 'dErP.com', |
There was a problem hiding this comment.
Considering the amount of setup such a test case has to do I went for hogging on to the existng one. This could of course also be a standalone test case if we wanted it to.
There was a problem hiding this comment.
nah, I think leaving it like this is fine
| { | ||
| $user = $request->user(); | ||
| $submittedDomain = $request->input('domain'); | ||
| $submittedDomain = strtolower($request->input('domain')); |
There was a problem hiding this comment.
Not sure about strings in PHP, does this need to be strtolower or mb_strtolower?
There was a problem hiding this comment.
either would do, I think there is no point in using mb_strlower which I assume is internally more expensive and complex.
This would be necessary if we were to go on to support multibyte chars in this place but since we filter any of those out with the validator I think it doesn't matter (and I don't think we'd ever want to support these in our domain names).
318036e to
c742a48
Compare
tarrow
left a comment
There was a problem hiding this comment.
looks good to me. l can confirm this works as I'd expect locally. :)
Ticket https://phabricator.wikimedia.org/T339860
I was able to test this locally, both with subdomains as well as custom domain names.