Skip to content
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

\r\n in version diff is not properly escaped #866

Closed
lainverse opened this issue Jan 21, 2021 · 1 comment
Closed

\r\n in version diff is not properly escaped #866

lainverse opened this issue Jan 21, 2021 · 1 comment

Comments

@lainverse
Copy link

lainverse commented Jan 21, 2021

Example: https://greasyfork.org/en/scripts/19993-ru-adlist-js-fixes/diff?v1=893106&v2=892759
Observed:

-                            args[1] = () => {
-                                eval(str.replace(/^function\s*\(\)/, 'function pwd()').replace(/if[^
-]*clientHeight[^
-]*\)\s*{/, 'if (false) {') + ' pwd();');
-                            }
+                            args[1] = () => alterEval(
+                                str.replace(/^function\s*\(\)/, 'function pwd()')
+                                .replace(/if[^
+]*clientHeight[^
+]*\)\s*{/, 'if (false) {') + ' pwd();'
+                            )();

Expected:

-                            args[1] = () => {
-                                eval(str.replace(/^function\s*\(\)/, 'function pwd()').replace(/if[^\r\n]*clientHeight[^\r\n]*\)\s*{/, 'if (false) {') + ' pwd();');
-                            }
+                            args[1] = () => alterEval(
+                                str.replace(/^function\s*\(\)/, 'function pwd()')
+                                .replace(/if[^\r\n]*clientHeight[^\r\n]*\)\s*{/, 'if (false) {') + ' pwd();'
+                            )();
@JasonBarnabe
Copy link
Collaborator

samg/diffy#113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants