mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
Merge pull request #32959 from overleaf/ab-fix-32861-spam-safe-project-name
[saas-e2e] Fix project name generation still producing + and / characters GitOrigin-RevId: 2367c8d45ee9ec4441e9ee2a1d74c2fd281f9e90
This commit is contained in:
committed by
Copybot
parent
926d6bccd7
commit
77b9d2fd1b
@@ -245,7 +245,8 @@ export function getSpamSafeProjectName() {
|
||||
// Move from hex/16 to base64/64 possible characters per char in string
|
||||
const name = Buffer.from(uuid().replaceAll('-', ''), 'hex')
|
||||
.toString('base64')
|
||||
.replace('/', '_')
|
||||
.replaceAll('/', 'x')
|
||||
.replaceAll('+', 'y')
|
||||
.slice(0, 10)
|
||||
const nDigits = (name.match(/\d/g) || []).length
|
||||
if (nDigits < 6) return name
|
||||
|
||||
Reference in New Issue
Block a user