Wedge
Public area => Bug reports => The Pub => Archived fixes => Topic started by: Arantor on March 19th, 2012, 12:32 PM
-
Multiple cases now we've seen preparsing (especially on edits, but sometimes on first posting) perform hard conversion of bare URLs to [url]link[/url], especially when it occurs inside img tags, breaking the tag.
I've seen this on and off for a while but I thought I'd fixed it a bit back - but apparently not.
-
I've just had a look at the database. Post #270447. It has a full link inside a quote. Something pretty much like what's broken these days...
Here's the part in the field: It's that film: [url][url]http://www.imdb.com/title/tt0079474/[/url][/url]
Meaning that the database DOES record the url tag in it. Which I find perfectly normal.
So the problem happens when importing the message at quote or quick edit time, right..?
I don't know if you'd gone as far as this in your research, I just wanted to post my results.
-
Oh... Very interesting. I put the extract inside nobbc and tt tags.
Believe it or not -- Wedge added the extra layer of url tags by itself. Didn't edit or anything! So, in the database, there's only one url tag. Just to make it clear...
:edit: Just in case, I tried to re-do it, same again. Even before the auto-save kicked in.
-
Meaning that the database DOES record the url tag in it. Which I find perfectly normal.
No, that's not normal. It's not supposed to do that. Take a look at SMF, it doesn't - it leaves the bare URL and processes it into url tags come parsing, not preparsing.
-
Then how come Wedge.org did it back when we were using SMF on it...? :-/
-
It didn't as far as I remember.
-
It may be due to a change in Wedge.org, then. The only change I can think of is the one to trim whitespace around quotes (which I stumbled upon yesterday while trying to remember how Noisen did it without fucking with noae tags...):
// !!! Purifying quotes (change noae?)
$message = preg_replace('~(?:<br />|\s)*(?:\)?\[(/?)quote(.*?)\](?:\)?(?:<br />| |\s)*~is', '[$1quote$2]', $message);
$message = preg_replace('~(?:<br />|\s)*(\[url=[^]]*?)?\[img( align=center)?]([^\[]+?)\[/img](\[/url])?(<br />| |\s)*~is', '$1[img$2]$3[/img]$4', $message);
But it doesn't look like it's doing anything special... Really couldn't find anything else in the entire codebase related to url tags.
-
It's even adding it inside nobbc codes, prior to the nobbc itself being processed. Since nobbc is almost the first operation in preparsecode, that would imply the problem with this actually occurs prior to preparsecode, which implies a bug in the auto embedder.
-
I see. I'll try disabling it then.
-
That's a point, if you nobbc something like a YT URL, does it still attempt to embed it?
-
OK, so I've been doing some more work on this.
Quick modify never calls aeva_onposting(), so the changes there never occur in quick modify. There is another bug involved here, namely that content inside a nobbc is modified by aeva_onposting when IMO it should not be, that's fixable easily enough by just updating the $array in aeva_onposting to include the nobbc tag.
The problem is predominantly aeva_autolink_urls(), if I comment the call out to that from aeva_onposting(), it stops injecting so many url bbcodes. I'm not sure, but I think you could remove that code entirely and everything would still work - certainly in my limited test cases it still finds videos properly even when bare linked.
-
This seems to be fixed now Nao has altered the code, and I've certainly not seen any problems since :)
-
Yeah it works for me too, but it also means that quick reply has issues with Aeva embedding to begin with, since it doesn't execute that code...
-
Does it? I've not noticed any other problems since then.
-
Maybe I'm just scared for nothing. I did spend a lot of time on this shit back then...
-
Well, try it, play around with it and if it breaks, we'll fix it, but it seems to work right now :)