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/tests/unit/lib
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
..
allow-lister-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
bookmark-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
break-string-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
category-badge-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
click-track-edit-history-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
click-track-profile-page-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
click-track-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
computed-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
emoji-store-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
emoji-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
formatter-test.js UX: Move do not disturb to profile panel (#11592) 2020-12-31 08:39:06 -06:00
get-url-test.js FIX: broken URL when username contains subfolder. (#11786) 2021-01-22 08:43:14 +11:00
highlight-search-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
i18n-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
icon-library-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
key-value-store-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
keyboard-shortcuts-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
link-lookup-test.js FIX: Normalize links by converting them to lower case 2020-12-11 11:16:51 -05:00
link-mentions-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
load-script-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
oneboxer-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
parse-bbcode-tag-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
preload-store-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
pretty-text-test.js FEATURE: Replace single dash arrows when the typographer is enabled. (#11730) 2021-01-18 09:03:58 -03:00
sanitizer-test.js FIX: Autoplay videos must always be muted (#11533) 2020-12-21 14:55:00 -03:00
screen-track-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
search-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
sharing-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
text-direction-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
to-markdown-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
upload-short-url-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
uploads-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
url-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
user-search-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
utilities-test.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00