SMFHacks.com

Modifications/Themes => Modifications Talk => Topic started by: Oldiesmann on February 18, 2019, 07:01:54 pm

Title: Pretty URLs and 2.1
Post 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:

Code: [Select]
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.
Title: Re: Pretty URLs and 2.1
Post by: Oldiesmann on February 18, 2019, 07:06:50 pm
I should note that this still happens even when using the most recent version of the mod.
Title: Re: Pretty URLs and 2.1
Post by: SMFHacks on February 18, 2019, 07:52:58 pm
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.
Code: [Select]
$buffer = str_replace('javascript:self.close()"','javascript:self.close();"',$buffer);

I am still trying to narrow it down..
Title: Re: Pretty URLs and 2.1
Post by: Oldiesmann on February 18, 2019, 08:24:33 pm
What file do I add that in?
Title: Re: Pretty URLs and 2.1
Post by: SMFHacks on February 18, 2019, 08:44:40 pm
I had it in Pretty-Urls-Filter.php

After
Code: [Select]
// 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);
Title: Re: Pretty URLs and 2.1
Post by: Oldiesmann on February 18, 2019, 09:39:38 pm
That fixed it. Thanks!
Title: Re: Pretty URLs and 2.1
Post by: SMFHacks on February 18, 2019, 09:40:57 pm
It's very strange for two reasons one that the ; gets stripped out to.
And second that the ; makes a difference!
Title: Re: Pretty URLs and 2.1
Post by: SMFHacks on March 07, 2019, 11:23:09 pm
I think also fixed email notifications issue for 2.1