discourse/app/assets/javascripts/discourse-common
Krzysztof Kotlarek 5cbb522c41
FIX: broken URL when username contains subfolder. (#11786)
The bug was mentioned on [meta](https://meta.discourse.org/t/two-bugs-with-usernames-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.
2021-01-22 08:43:14 +11:00
..
addon FIX: broken URL when username contains subfolder. (#11786) 2021-01-22 08:43:14 +11:00
app DEV: Make `discourse-common` an Ember addon. (#9578) 2020-04-29 12:18:21 -04:00
config DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
vendor DEV: Make `discourse-common` an Ember addon. (#9578) 2020-04-29 12:18:21 -04:00
ember-cli-build.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
index.js REFACTOR: Support bundling our `admin` section as an ember addon 2020-09-22 15:14:29 -04:00
package.json DEV: Fix package.json issues and reroll yarn.lock 2020-08-14 12:00:35 +02:00
yarn.lock Build(deps): Bump lodash in /app/assets/javascripts/discourse-common 2020-09-08 10:25:31 -04:00