mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +00:00
streams: Fix malformed stream name slugs.
The stream_data.id_to_slug and stream_data.name_to_slug functions mistakenly used Javascript's String.replace method, this commit changes it to use String.replaceAll, the result being slugs generated from streams with names greater than 2 words are now properly formatted.
This commit is contained in:
@@ -282,7 +282,7 @@ export function id_to_slug(stream_id) {
|
||||
|
||||
// The name part of the URL doesn't really matter, so we try to
|
||||
// make it pretty.
|
||||
name = name.replace(" ", "-");
|
||||
name = name.replaceAll(" ", "-");
|
||||
|
||||
return stream_id + "-" + name;
|
||||
}
|
||||
@@ -296,7 +296,7 @@ export function name_to_slug(name) {
|
||||
|
||||
// The name part of the URL doesn't really matter, so we try to
|
||||
// make it pretty.
|
||||
name = name.replace(" ", "-");
|
||||
name = name.replaceAll(" ", "-");
|
||||
|
||||
return stream_id + "-" + name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user