-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed prototypejs from varien/product.js, varien/configurable.js and configurableswatches/swatches-product.js #68
base: main
Are you sure you want to change the base?
Conversation
for (const part of parts) { | ||
if (part.includes('[')) { | ||
const [name, index] = part.split('['); | ||
const cleanIndex = parseInt(index.replace(']', '')); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 hours ago
To fix the problem, we need to ensure that all occurrences of the closing bracket (]
) in the index
string are replaced. This can be achieved by using a regular expression with the global flag (g
). Specifically, we should replace index.replace(']', '')
with index.replace(/\]/g, '')
.
-
Copy modified line R698
@@ -697,3 +697,3 @@ | ||
const [name, index] = part.split('['); | ||
const cleanIndex = parseInt(index.replace(']', '')); | ||
const cleanIndex = parseInt(index.replace(/\]/g, '')); | ||
value = value[name][cleanIndex]; |
Absolutely, I'll test first thing tomorrow. Also nice on making a new |
heheh good that you need that Template class :-) we can't really avoid having it :-) |
It seems to me that everything is working correctly but since I had 1000 problems with these files I'd like for somebody else to give them a test.
EDIT: product page should work with or without prototypejs
@justinbeaty would you review this? :-)