Closed smarr closed 5 months ago
Before this PR, we used the project name, which can contain arbitrary unsafe characters. Though, the project slug is already safe.
So, we just use that one.
It's safe, because projects are created in recordProject() with
recordProject()
INSERT INTO Project (name, slug) VALUES ($1, regexp_replace($2, '[^0-9a-zA-Z-]', '-', 'g')) RETURNING *
This means, all none number and a-z characters are replaced with - and made safe.
-
See https://github.com/smarr/ReBenchDB/blob/f84de3f1f6cf4f77a4639cc170999d5e129c1e5b/src/backend/db/db.ts#L496-L509
Before this PR, we used the project name, which can contain arbitrary unsafe characters. Though, the project slug is already safe.
So, we just use that one.
It's safe, because projects are created in
recordProject()
withThis means, all none number and a-z characters are replaced with
-
and made safe.See https://github.com/smarr/ReBenchDB/blob/f84de3f1f6cf4f77a4639cc170999d5e129c1e5b/src/backend/db/db.ts#L496-L509