smarr / ReBenchDB

ReBenchDB records benchmark results and provides customizable reporting to track and analyze run-time performance of software programs.
MIT License
12 stars 6 forks source link

Fix CSV Data File export (Resolves #198) #199

Closed smarr closed 5 months ago

smarr commented 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

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