diff --git a/src/Signer.ts b/src/Signer.ts index 17c4e55..004405c 100644 --- a/src/Signer.ts +++ b/src/Signer.ts @@ -122,7 +122,7 @@ export class Signer { let pattern = new RegExp( "[^'\"]*?)" + this.cartPath + - "(.php)??(?.*?)\\1[^>]*?>", + "(.php)?\?(?.*?)\1[^>]*?>", "gi" ); return matchGroups(html, pattern); @@ -130,7 +130,7 @@ export class Signer { private __getFormCodes(form: string): Product[] { const regex = new RegExp( - "<[^>]*?name=(['\"])(?[0-9]{1,3}:)?code\\1[^>]*?>", + "<[^>]*?name=(['\"])(?[0-9]{1,3}:)?code\1[^>]*?>", "ig" ); const codes = matchGroups(form, regex); @@ -178,7 +178,7 @@ export class Signer { const pattern = "(?https?://)(?[^?/]*?)" + this.cartPath + - "(.php)?\\?(?.*)"; + "(.php)?\?(?.*)"; const match = url.match(pattern); if (!match || !match.groups) { return url; @@ -356,7 +356,7 @@ export class Signer { let pattern = new RegExp( "", + "(?![0-9]{1,3})(?.+?)\1[^>]*>(?.*?)", "isg" ); for (let textarea of matchGroups(html, pattern)) { @@ -498,7 +498,7 @@ export class Signer { const regex = new RegExp( `href=(['"])${queryString.domain}${ this.cartPath - }(\.php)?.${queryString.query.replace(/^\?/, "")}\\1` + }(\.php)?.${queryString.query.replace(/^\?/, "")}\1` ); if (signed != url) { html = html.replace(regex, `href="${signed}"`);