slugs: Fix regex for legacy stream slugs.

This prevents a bug where we interpret "2something"
as a modern slug instead of a legacy stream name.

The bug was probably somewhat unlikely to happen in
practice, since it only manifests if 2 is an actual
stream_id.
This commit is contained in:
Steve Howell
2021-02-10 13:31:52 +00:00
committed by Tim Abbott
parent 34b98a1cf6
commit d67cc2d080
2 changed files with 6 additions and 1 deletions

View File

@@ -328,7 +328,7 @@ exports.slug_to_name = function (slug) {
GitHub conversations. We migrated to modern slugs in
early 2018.
*/
const m = /^(\d+)(-.*)?/.exec(slug);
const m = /^(\d+)(-.*)?$/.exec(slug);
if (m) {
const stream_id = Number.parseInt(m[1], 10);
const sub = subs_by_stream_id.get(stream_id);