# 서브폴더 이름으로 시작하는 사용자 이름 관련 버그 2건

**URL:** https://meta.discourse.org/t/two-bugs-with-usernames-starting-with-subfolder-name/169505
**Category:** Bug
**Tags:** subfolder
**Created:** [11월 7, 2020, 9:28오전 UTC](https://meta.discourse.org/t/two-bugs-with-usernames-starting-with-subfolder-name/169505 "2020-11-07T09:28:58Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![kris.kotlarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kris.kotlarek/32/176919_2.png) [@kris.kotlarek](https://meta.discourse.org/u/kris.kotlarek)
#### Post date: [2월 11, 2021, 4:08오전 UTC](https://meta.discourse.org/t/two-bugs-with-usernames-starting-with-subfolder-name/169505/6 "2021-02-11T04:08:50Z")

</div>

해당 PR로 수정되었습니다.

> <https://github.com/discourse/discourse/pull/11786>
>
> The bug was mentioned on \[meta\](https://meta.discourse.org/t/two-bugs-with-usern…ames-starting-with-subfolder-name/169505)
> 
> When discourse is installed on \`/subfolder\` and username is containing subfolder name like for example \`subfolderadmin\` - user URLs were incorrect.
> 
> Instead of having \`/subfolder/u/subfolderadmin/summary/\` we were leading to \`/subfolder/uadmin/summary\`.
> 
> The reason for that was incorrect check in \`getUrl\` helper:
> 
> \`\`\`javascript
> const found = url.indexOf(baseUri);
> if (found \>= 0 && found \< 3) {
> return url;
> }
> return baseUri + url;
> \`\`\`
> baseUri is \`/subfolder\`, url is \`/u/subfolderadmin\` and indexOf returned position which in the end returned incorrect URL.
> 
> I think that we should check if the URL starts with baseUri and not if contains baseUri.

---

_[View the full topic](https://meta.discourse.org/t/two-bugs-with-usernames-starting-with-subfolder-name/169505)._
