fix(tasks): correct URL basename extraction for trailing slashes

URLs ending with '/' were incorrectly truncating the last character
of the path segment when extracting attachment titles.

Example fix:
- Input: https://example.com/path/
- Before: "pat" (lost one character)
- After: "path" (correct)

Changed substring offset from -2 to -1 to properly remove only
the trailing slash character.
This commit is contained in:
Johannes Millan 2026-01-20 18:55:43 +01:00
parent c49209d364
commit 22adb1df45

View file

@ -547,7 +547,7 @@ const _baseNameForUrl = (passedStr: string): string => {
const str = passedStr.trim();
let base;
if (str[str.length - 1] === '/') {
const strippedStr = str.substring(0, str.length - 2);
const strippedStr = str.substring(0, str.length - 1);
base = strippedStr.substring(strippedStr.lastIndexOf('/') + 1);
} else {
base = str.substring(str.lastIndexOf('/') + 1);