Skip to content

Commit 78b6196

Browse files
fix regex to allow numbers
1 parent b66d2a6 commit 78b6196

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

server.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ app
368368
});
369369

370370
let GBdetails = {};
371+
const isAlphanumericLess50 = /^[a-zA-Z0-9]{1,50}$/;
371372
server.get("/check", async (req, res) => {
372373
const { bookid, option, email, userName, IAtitle } = req.query;
373374
emailaddr = email;
@@ -387,7 +388,6 @@ app
387388
IAtitle.trim() !== ""
388389
? replaceTitle(IAtitle.trim())
389390
: replaceTitle(data.volumeInfo.title);
390-
const isAlphanumericLess50 = /^(?![0-9]+$)[a-zA-Z0-9]{1,50}$/;
391391
if (isAlphanumericLess50.test(titleInIA) === false) {
392392
res.send({
393393
isInValidIdentifier: true,
@@ -432,7 +432,6 @@ app
432432
IAtitle.trim() !== ""
433433
? replaceTitle(IAtitle.trim())
434434
: replaceTitle(await getPDLTitle(options));
435-
const isAlphanumericLess50 = /^(?![0-9]+$)[a-zA-Z0-9]{1,50}$/;
436435
if (titleInIA === "") {
437436
res.send({
438437
error: true,
@@ -490,7 +489,6 @@ app
490489
IAtitle.trim() !== ""
491490
? replaceTitle(IAtitle.trim())
492491
: replaceTitle(name);
493-
const isAlphanumericLess50 = /^(?![0-9]+$)[a-zA-Z0-9]{1,50}$/;
494492
if (isAlphanumericLess50.test(titleInIA) === false) {
495493
res.send({
496494
isInValidIdentifier: true,

0 commit comments

Comments
 (0)