Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Arebias on December 09, 2010, 01:59:40 PM

Title: This code does not show in a post. Why?
Post by: Arebias on December 09, 2010, 01:59:40 PM


Why will the following code no longer work in 2.0 RC4? It worked fine in the older versions.







[center][url=http://www.gametracker.com/server_info/64.94.238.250:27960/][img]http://cache.[url=http://www.gametracker.com/server_info/64.94.238.250:27960/b_560_95_1.png]www.gametracker.com/server_info/64.94.238.250:27960/b_560_95_1.png[/url][/img][/url][/center]


Title: Re: This code does not show in a post. Why?
Post by: Spoogs on December 09, 2010, 02:50:44 PM
Not really seeing how that ever worked but you could just check the images url to see if the image is still available.
Title: Re: This code does not show in a post. Why?
Post by: flapjack on December 09, 2010, 02:59:14 PM
[img]http://cache.[url=http
it will never work
Title: Re: This code does not show in a post. Why?
Post by: kat on December 09, 2010, 03:17:27 PM
Not in a million years.

[center][url=http://www.gametracker.com/server_info/64.94.238.250:27960/][img]http://www.gametracker.com/server_info/64.94.238.250:27960/b_560_95_1.png[/img][/url][/center]

might, though, if the image actually exists.
Title: Re: This code does not show in a post. Why?
Post by: flapjack on December 09, 2010, 03:45:11 PM
I don't think it's static image, more likely it's dynamically generated, if you're having problems maybe the generator doesn't work?
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 09, 2010, 04:14:41 PM


(http://cache.www.gametracker.com/server_info/63.251.20.161:27960/b_560_95_1.png) (http://www.gametracker.com/server_info/63.251.20.161:27960/)

[center][url=http://www.gametracker.com/server_info/63.251.20.161:27960/][img]http://cache.www.gametracker.com/server_info/63.251.20.161:27960/b_560_95_1.png[/img][/url][/center]


Ok. There is the actual code that does work. Here is the problem. When I place this code in a post and hit preview it shows properly. As soon as I hit save it then mangles the code to that in which I first posted.

Yes you are exactly right. Not in a million years. However I did not notice that it was actually mangling the code until just now.

So the question is this: What would cause the code to get changed from the above to:

[center][url=http://www.gametracker.com/server_info/77.92.85.50:27960/][img]http://cache.[url=http://www.gametracker.com/server_info/77.92.85.50:27960/b_560_95_1.png]www.gametracker.com/server_info/77.92.85.50:27960/b_560_95_1.png[/url][/img][/url][/center]


Which of course does not work.  ??? Anyone know?

I removed every mod I have installed trying to use the process of elimination yet nothing seemed to change the occurrence.





Title: Re: This code does not show in a post. Why?
Post by: kat on December 09, 2010, 04:19:06 PM
That's sorted, then? :)
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 09, 2010, 04:22:28 PM

No sir. Not yet.
Title: Re: This code does not show in a post. Why?
Post by: flapjack on December 09, 2010, 04:24:07 PM
what if you just remove "cache." from the address?
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 09, 2010, 04:31:13 PM

Then it does not work neither here nor on our site. However it does not mangle the code. It just simply does not work.


So essentially on our site it will not accept the http://cache.www.gametracker.com/server_info/ (http://cache.www.gametracker.com/server_info/)

Without stripping it.         

[img]http://cache.[url=http://www.gametracker.com/server_info/
                     

We just upgraded from 1.1.11 to 2.0 RC4

Title: Re: This code does not show in a post. Why?
Post by: kat on December 09, 2010, 04:39:25 PM
Is this not right, then?

(http://cache.www.gametracker.com/server_info/63.251.20.161:27960/b_560_95_1.png) (http://www.gametracker.com/server_info/63.251.20.161:27960/)
Title: Re: This code does not show in a post. Why?
Post by: flapjack on December 09, 2010, 04:43:06 PM
^^^ works fine
Title: Re: This code does not show in a post. Why?
Post by: kat on December 09, 2010, 04:44:34 PM
Then I'm confused... (http://www.katzy.dsl.pipex.com/Smileys/matchstick/shakehead.gif)
Title: Re: This code does not show in a post. Why?
Post by: Spoogs on December 09, 2010, 04:50:46 PM
K@ that code has the cached part in it.. OP is saying when its posted on their site it gets all mangled like in the first post.
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 09, 2010, 04:52:53 PM


Let me try this again.

Yes that code that you used in order to get that banner to show up is correct. And on this site that code is passed correctly and the result is the image that you see.

On our site when that very same code is entered, and you choose 'Preview', it shows correctly, just as the above example you posted, but only in preview. It is after you hit 'Save' that the forum changes the code to what I initially posted. It Mangles The Code upon Save.


Did I do better at explaining it this time?
Title: Re: This code does not show in a post. Why?
Post by: kat on December 09, 2010, 04:54:35 PM
You did.

Do you have anything in word censoring that might cause this?
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 09, 2010, 04:56:13 PM

Nothing! Turned off.
Title: Re: This code does not show in a post. Why?
Post by: kat on December 09, 2010, 05:04:46 PM
I just tried it on my RC4 forum and it works, perfectly.

Do you have any mods, such as PrettyURLS, that might be affecting this?
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 09, 2010, 05:24:19 PM

No pretty urls.





1.    Quick Translation    0.3   
2.    MessagePreviewOnHover    1.7 
3.    FantasticSmileys    1.0   
4.    Custom Form Mod    1.6   
5.    Export Personal Messages    1.3.3   
6.    Treasury    2.08   
7.    Add IP2Location to Track IP    1.3   
8.    Switch Permissions    1.0   
9.    Search User In MP    1.1   
10.    SimplePortal    2.3.3   
11.    Users Online Today    1.5.6   
12.    PM Attachments    1.6   
13.    OS & Browser Detection    1.5   
14.    Last Active On MemberList    1.4   
15.    Aeva Media    1.4c   
16. nneonneo AdvShout Box 1.22


As previously stated I removed all these mods in an attempt to eliminate which one was at fault. There was no difference.

I guess what would help me is to know which php files deal with that particular action. I am assuming Post.php

If I could narrow this down to which ones actually affect this function of parsing BBC during a post I could then go through in a line by line comparison with a stock php file from the upgrade zip.
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 09, 2010, 08:30:12 PM


Come on fella's. Did you give up?  :o


Title: Re: This code does not show in a post. Why?
Post by: kat on December 10, 2010, 08:21:36 AM
No.

Even I have to sleep, occasionally, though.

Do me a favour, will you?

Copy/paste this in to a post on your forum.

[url=http://www.simplemachines.org][img]http://www.katzy.dsl.pipex.com/Smileys/link.gif[/img][/url]

(http://www.katzy.dsl.pipex.com/Smileys/link.gif) (http://www.simplemachines.org)

Does it work, OK?

If you click the image, does it bring you here?
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 10, 2010, 11:33:54 AM


Yes. It worked just fine. It created the image, the link worked, and when I went back and hit "modify' the link was in it's original state. It did not mangle the link like it does the one I placed in there.

So apparently it has something to do with the word 'cache' being in front of the www. as in cache.www.


Title: Re: This code does not show in a post. Why?
Post by: XerraX on December 10, 2010, 11:52:27 AM
we are having the same problem in our forums.

smf 2 rc4

ps: other thread, but same problem ->
http://www.simplemachines.org/community/index.php?topic=412178.msg2874107#msg2874107
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 10, 2010, 12:39:01 PM

@XerraX  ...    Please take a look at the list of Mod's that we have installed and compare to your list then post the similarities. What Mod's do we have in common?

Title: Re: This code does not show in a post. Why?
Post by: XerraX on December 10, 2010, 12:52:47 PM
Search User In MP
Users Online Today
Aeva Media (we use Aeva lite)

btw funny thing is, that in signature area the code works, only in post content area it does not.
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 10, 2010, 01:19:15 PM

Quote from: XerraX on December 10, 2010, 12:52:47 PM
btw funny thing is, that in signature area the code works, only in post content area it does not.


As it does on ours as well. I just checked this out. In signatures it works, In posts it does not.


And from the list above the only Mod that I can see that would be parsing any links would be Aeva Media. More than likely this is the culprit. I did uninstall everything however there could have been some code manipulation involved with the Aeva that was not removed or that I missed.

But Aeva was installed on the 1.1.11 version and all worked well on that. ???

Title: Re: This code does not show in a post. Why?
Post by: XerraX on December 10, 2010, 01:55:58 PM
Small workaround is to disable "Automatically link posted URLs" in:
smf/admin/?area=postsettings;sa=bbc

but then an important feature is missing.  :(
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 10, 2010, 02:42:47 PM

Fixed!

OK. I uninstalled Aeva Media and went through and made sure that every instance of this mod was removed. I must have missed something before.

Now it is not parsing the link and the banner shows up properly as it does here on this forum.

So to summarize: With the Aeva Mod the parsing of the URL is a problem in a post but works fine in signatures. Without the mod installed the forum works as intended.

I will go to the Aeva thread and web site and post a link to this topic and inform them of the problem and they can go from there if they wish.


Title: Re: This code does not show in a post. Why?
Post by: kat on December 10, 2010, 02:53:06 PM
I had another thought, about this one.

Could the link be changed, using tinyurl?

http://tinyurl.com
Title: Re: This code does not show in a post. Why?
Post by: XerraX on December 10, 2010, 02:59:46 PM
i made myself a dirty hack:

open Sources/Subs-Aeva.php

Search for

// Links urls that haven't already been linked
function aeva_autolink_urls($input)
{
global $context, $modSettings;

// Should haven't got here if autolinking of urls is disabled
if (empty($modSettings['autoLinkUrls']))
return $input;


and replace it with:


// Links urls that haven't already been linked
function aeva_autolink_urls($input)
{
global $context, $modSettings;

// Should haven't got here if autolinking of urls is disabled
if (empty($modSettings['autoLinkUrls']))
return $input;

if (preg_match("/gametracker/i", $input))
return $input;
Title: Re: This code does not show in a post. Why?
Post by: Kindred on December 10, 2010, 03:12:04 PM
???
Didn't I just go over this with someone?

This is a problem with smf (sort of) not with aeva.
mostly, it's a problem with that website ont using a standard url address format.

The problem is that smf interprets www as the START of a web address, so it is attempting to make the URL that is SEES into a link because that cache.www screws it up.


I honestly don't call this an actual SMF "bug" and I would prefer telling the stupid people who used that format or url to use a proper format.
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 10, 2010, 03:21:49 PM

Well I read all that pertains to this in the other thread XerraX referred me to. I saw what you said. If you really think that they are going to change the format that they use based on this forum platform not being able to parse it correctly then I guess I could try that approach. I seriously doubt it though.

I kinda like where XerraX is going. Could someone with the coding knowledge possibly determine why the word 'cache' seems to cause this? In the example K@ posted for me to troubleshoot with
[url=http://www.simplemachines.org][img]http://www.katzy.dsl.pipex.com/Smileys/link.gif[/img][/url]

it worked fine. It seems that the word 'cache' is the problem. 


Never mind I re-read your response over there on the other thread.

Title: Re: This code does not show in a post. Why?
Post by: XerraX on December 10, 2010, 03:25:39 PM
its not the word cache, its the . (dot) + www the parser thinks that with www a new url starts.

http://cache.   www.gametracker.com/server_info

http://www.katzy.dsl.pipex.com/Smileys/link.gif

if you look at the code you can see it:


// Parse any URLs....
if (preg_match('~http://|www\.~i', $input))


http:// OR www
Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 10, 2010, 03:50:16 PM


Ok. So can the code be changed to this and it still work:


// Parse any URLs....
   if (preg_match('~http://|www|cache.www\.~i', $input))



I am asking you to try because I removed it 100% from my site and am not going to re-install until I have a good fix.

Title: Re: This code does not show in a post. Why?
Post by: Arebias on December 10, 2010, 06:54:54 PM

I had the full gallery version and that is why I did not have Subs-Aeva.php. I installed the lite version that you have on my testing site and your fix works just fine for that.

I tried that other I suggested and although it caused no errors it did nothing to fix the problem. I think I will just install the lite version as you have and change the code to what you suggested and go with that.

Thanks!

Title: Re: This code does not show in a post. Why?
Post by: XerraX on December 11, 2010, 07:38:21 AM
Oh i see... in Aeva full it should be Aeva-Embed.php

same code to replace

i didnt test it. but it seems to be the same code.
Title: Re: This code does not show in a post. Why?
Post by: mianosm on June 28, 2012, 06:54:32 AM
Quote from: XerraX on December 10, 2010, 02:59:46 PM
i made myself a dirty hack:

open Sources/Subs-Aeva.php

Search for


// Links urls that haven't already been linked
function aeva_autolink_urls($input)
{
global $context, $modSettings;

// Should haven't got here if autolinking of urls is disabled
if (empty($modSettings['autoLinkUrls']))
return $input;


and replace it with:


// Links urls that haven't already been linked
function aeva_autolink_urls($input)
{
global $context, $modSettings;

// Should haven't got here if autolinking of urls is disabled
if (empty($modSettings['autoLinkUrls']))
return $input;

if (preg_match("/gametracker/i", $input))
return $input;



This is an excellent fix, seemingly still working.

Quote
SMF 2.0.2 | SMF © 2011, Simple Machines
SimplePortal 2.3.5 © 2008-2012, SimplePortal
Embedding by Aeva Media, © Noisen Aeva ~ Auto-Embed Video & Audio    7.1

If you're still subscribed or reading: thanks a bunch XerraX
Title: Re: This code does not show in a post. Why?
Post by: MrPhil on June 28, 2012, 09:54:43 AM
It's more of a hack/workaround than a real fix, because now your code has a deeply embedded reference specific to your domain name. At the very least, make a list somewhere of such things so you can remember to update them all should you move your site or SMF be updated.

If the basic problem is that <some subdomain>.www.domain.TLD is not being treated as a single unit in automatic link generation, then something needs to be done to fix that. Frankly, I've never understood people who write www.<subdomain>.domain.TLD or <subdomain>.www.domain.TLD -- it makes no sense (v. <subdomain>.domain.TLD) -- but still, SMF should properly handle it. If the autolink code keys off of www., it is somewhat limited in that it won't pick up subdomains, but that's a separate issue.
Title: Re: This code does not show in a post. Why?
Post by: Arantor on June 28, 2012, 02:16:55 PM
Autolink works off the fact it sees www. - how else, exactly, would you reliably (and efficiently) do it for all subdomains?