This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse
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
..
app DEV: Sync up more Ember CLI features (#11790) 2021-01-21 15:55:39 -05:00
config Sync up master with Ember CLI branch where possible (#11707) 2021-01-14 12:52:51 -05:00
public/assets/scripts Sync up master and Ember CLI branches again (#11746) 2021-01-18 16:12:45 -05:00
tests FIX: broken URL when username contains subfolder. (#11786) 2021-01-22 08:43:14 +11:00
.ember-cli REFACTOR: Sync up master with changes for Ember-CLI (#11671) 2021-01-12 10:13:21 -05:00
ember-cli-build.js Sync up master and Ember CLI branches again (#11746) 2021-01-18 16:12:45 -05:00
package.json Sync up master and Ember CLI branches again (#11746) 2021-01-18 16:12:45 -05:00
testem.js Sync up master and Ember CLI branches again (#11746) 2021-01-18 16:12:45 -05:00