mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 09:58:14 +01:00
add regex for vid ids
This commit is contained in:
parent
62d7def602
commit
78de660963
1 changed files with 7 additions and 0 deletions
|
@ -190,6 +190,13 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
return res.redirect("/");
|
return res.redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const regex = new RegExp("^([a-zA-Z0-9_-]{11})");
|
||||||
|
const isMatch = regex.test(v);
|
||||||
|
|
||||||
|
if (!isMatch) {
|
||||||
|
return res.redirect("/");
|
||||||
|
}
|
||||||
|
|
||||||
var contentlang = hl || "en-US";
|
var contentlang = hl || "en-US";
|
||||||
var contentregion = region || "US";
|
var contentregion = region || "US";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue