SMFHacks.com
Modifications/Themes => Modifications Talk => Topic started by: Oldiesmann on February 18, 2019, 07:01:54 pm
-
On my forum, when I enable URL rewriting, the form in the login popup never loads, even if I disable rewriting of the login action.
I get this error in the console in Chrome:
script.js:1016 Uncaught TypeError: Cannot use 'in' operator to search for 'addEventListener' in undefined
at createEventListener (script.js:1016)
at (index):402
createEventListener @ script.js:1016
(anonymous) @ (index):402
Apparently something is calling createEventListener without specifying an object. I haven't had time to dig into this further though.
-
I should note that this still happens even when using the most recent version of the mod.
-
From what I find on my test site it strips out the ; for this statement which is strange.
So i added this code in the filter section to place it back... but that is a band aid.
$buffer = str_replace('javascript:self.close()"','javascript:self.close();"',$buffer);
I am still trying to narrow it down..
-
What file do I add that in?
-
I had it in Pretty-Urls-Filter.php
After
// Put the URLs back into the buffer
$context['pretty']['replace_patterns'][] = '~(<a[^>]+href=|<link[^>]+href=|<form[^>]+?action=)(\"[^\"]+\"|\'[^\']+\')~';
foreach ($context['pretty']['replace_patterns'] as $pattern)
$buffer = preg_replace_callback($pattern, 'pretty_buffer_callback', $buffer);
-
That fixed it. Thanks!
-
It's very strange for two reasons one that the ; gets stripped out to.
And second that the ; makes a difference!
-
I think also fixed email notifications issue for 2.1