News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Exclamation mark links

Started by chadon, January 18, 2013, 08:51:05 AM

Previous topic - Next topic

chadon

I have been searching the forum and didn't find any topics related to my problem but I have been using SMF 2 for years and always used the "Pretty Url mod" and had problems with links being generated correctly when they contain an exclamation mark. The same happens with external links using this character.


I would like to know if this is a know bug for SMF 2 or if it's due to one of the many mods I have on my forum?


Example:
https://www.facebook.com/home.php#!/pages/page-name


chadon

I guess the bug is only on my forum.

Here is a post where you can see it:
http://www.mustangv8.com/fr/restaurations/restorationpreparation-'67-phoenix-project'/msg474861/#msg474861


Edit:

If it can help, here is a list of the mods installed on the forum:


1.   Global Headers Footers   2.0.1   [ Désinstaller ]
2.   SMF 2.0.3 Update   1.0   [ Désinstaller ]
3.   Tapatalk SMF 2.0 RC4/RC5/Final Plugin   3.2.0   [ Désinstaller ]
4.   News Letter Mod for SMF2   1.14   [ Désinstaller ]
5.   PMx-SubForums   1.35   [ Désinstaller ]
6.   Drafts   1.1.4   [ Désinstaller ]
7.   SA Chat   RC1 Rev58   [ Désinstaller ]
8.   SEO Sitemap   2.2   [ Désinstaller ]
9.   SMF Quiz   1.1.0   [ Désinstaller ]
10.   Stop Forum Spam   1.0   [ Désinstaller ]
11.   Adk Back To Top   1.0   [ Désinstaller ]
12.   Bookmarks   2.5   [ Désinstaller ]
13.   Highslide 4 SMF   0.7a   [ Désinstaller ]
14.   Simple .htaccess Cache Mod   2.6   [ Désinstaller ]
15.   InLine Attachments   1.11   [ Désinstaller ]
16.   nCode Image Resizer   1.3.1   [ Désinstaller ]
17.   SMF 2.0.2 Update   1.0   [ Désinstaller ]
18.   SMF Garage   2.2   [ Désinstaller ]
19.   Topic Descriptions   1.2   [ Désinstaller ]
20.   Smush.it!   0.1   [ Désinstaller ]
21.   SMF 2.0.1 Update   1.0   [ Désinstaller ]
22.   Curve mobile mod   1.1.1   [ Désinstaller ]
23.   Treasury   2.10   [ Désinstaller ]
24.   PaypalDonations   2.0   [ Désinstaller ]
25.   Enhancements to purge inactive members   1.2.2   [ Désinstaller ]
26.   Single Category   2.1.9   [ Désinstaller ]
27.   Related Topics   1.4   [ Désinstaller ]
28.   Member NotePad   2.0.2   [ Désinstaller ]
29.   Team Page   1.1.6   [ Désinstaller ]
30.   VigLink   1.0   [ Désinstaller ]
31.   Birthday Posts   0.12.1 Beta   [ Désinstaller ]
32.   Ultimate Profile   0.9.1   [ Désinstaller ]
33.   SMF Arcade   2.5 RC1   [ Désinstaller ]
34.   Resize Attached Images   2.3.1   [ Désinstaller ]
35.   Contact Page   3.0   [ Désinstaller ]
36.   BlogBridger   1.1.4   [ Désinstaller ]
37.   PM Attachments   1.6   [ Désinstaller ]
38.   Custom BBCode   2.03   [ Désinstaller ]
39.   vBulletin Style Meta Tags   1.1   [ Désinstaller ]
40.   Off-Topic BBC Tag   1.1.2-rc3   [ Désinstaller ]
41.   Google Member Map   2.0.7   [ Désinstaller ]
42.   EzPortal   0.5.1   [ Désinstaller ]
43.   Aeva Media   1.4w   [ Désinstaller ]
44.   Pretty URLs   1.0RC5.2

Kindred

The best suggestion that I can make is

install a test forum and confirm it works correctly
then one by one, install your mods and test after each install
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Storman™

I don't see an exclamation mark in that topic you gave as an example?

Anyway, I'm guessing that Pretty UrL's is changing them to another character (no idea what as I don't use it) which is why the url appears differently.

Personally I would get rid of Pretty Urls, it's a waste of time these days and is not necessary anymore.

(You have a lot of mods by the way  :o  )

chadon

#4
Quote from: Kindred on January 18, 2013, 09:25:03 AM
The best suggestion that I can make is

install a test forum and confirm it works correctly
then one by one, install your mods and test after each install
That will be a lot of work but if nobody can help me, I will do it. :) Thank you.

Quote from: Storman™ on January 18, 2013, 09:35:07 AM
I don't see an exclamation mark in that topic you gave as an example?

Anyway, I'm guessing that Pretty UrL's is changing them to another character (no idea what as I don't use it) which is why the url appears differently.

Personally I would get rid of Pretty Urls, it's a waste of time these days and is not necessary anymore.

(You have a lot of mods by the way  :o  )
The exclamation mark is on the Facebook link and when you click on it, the link doesn't generate with what is after the exclamation mark. It has nothing to do with Pretty URLs as the mod doesn't modify the links in the posts.

I don't need Pretty Urls today but search engines would send traffic to dead links and they would have to crawl the site all over again. I don't want to loose too much traffic.

About the mods, I know there is too many but that's what makes the forum popular so I can't remove them without having members protesting.  :D

Storman™

Ah, I see what you mean. Infact it's not an exclamation mark it's a shebang or hashbang, i.e. a (#!)

If I remember correctly both Facebook, and Twitter for that matter, use them to assist indexing by Google.

Still think it's Pretty Urls messing with them.

chadon

No, it's not the shebang/hashbang thing, it's the exclamation mark. I posted a new link two posts below the I posted earlier with just the exclamation mark and the same thing happens.

Storman™

Is this the one you mean ?

https://www.facebook.com/home.php!/pages/Racing-mustang-1967-67-phoenix-project/450867631647034

If so, then it appears ok as a full url in post preview, but not when posted.

I'm not sure why this happens as an exclamation mark is a valid character in a url, guess the code in SMF just works like that for some reason. (It does the same on my plain test board by the way so I don't think you have a fault).

chadon

Yes this one.


Users have to use bb code for it to generate properly, like this:


[url=https://www.facebook.com/home.php!/pages/Racing-mustang-1967-67-phoenix-project/450867631647034]https://www.facebook.com/home.php!/pages/Racing-mustang-1967-67-phoenix-project/450867631647034[/url]


But not when someone just copy and paste the link.

Storman™

I have sneaky feeling this is part of a bug fix thats planned for 2.1 but I can't seem to find anything about it at the moment.

Arantor

Quote from: Storman™ on January 18, 2013, 11:36:04 AM
I have sneaky feeling this is part of a bug fix thats planned for 2.1 but I can't seem to find anything about it at the moment.

Well, it's not a bug fix per se (depends on your point of view), since ! was never supposed to be used in URLs, but since a lot of places do so, SMF had to relax its checks to allow it.

chadon

I have the same bug with the Facebook link on a different forum.


Here are the mods both forums have:

2.   Contact Page   3.0   [ Désinstaller ]
3.   News Letter Mod for SMF2   1.14   [ Désinstaller ]
5.   SA Chat   RC1 Rev59   [ Désinstaller ]
6.   Drafts   1.1.4   [ Désinstaller ]
8.   Stop Forum Spam   1.0   [ Désinstaller ]
11.   SMF Garage   2.2   [ Désinstaller ]
12.   Custom BBCode   2.03   [ Désinstaller ]
13.   Ultimate Profile   0.9.1   [ Désinstaller ]
14.   PM Attachments   1.6   [ Désinstaller ]
17.   Highslide 4 SMF   0.7a   [ Désinstaller ]
18.   Google Member Map   2.0.8   [ Désinstaller ]
19.   Team Page   1.1.6   [ Désinstaller ]
21.   VigLink   1.0   [ Désinstaller ]
22.   Resize Attached Images   2.3.1   [ Désinstaller ]
24.   EzPortal   0.5.1   [ Désinstaller ]
25.   Pretty URLs   1.0RC5.2   [ Désinstaller ]
26.   Aeva Media   1.4w   [ Désinstaller ]
27.   InLine Attachments   1.0 Alpha 5   [ Désinstaller ]


Quote from: Storman™ on January 18, 2013, 11:36:04 AM
I have sneaky feeling this is part of a bug fix thats planned for 2.1 but I can't seem to find anything about it at the moment.
Isn't Simplemachines using the same version as the public one?

Arantor

SMF here is using 2.0.3, it is not using 2.1 yet on this site.

chadon

OK, my forums too so we can say it's not a bug from SMF itself. ???

Arantor

It's a condition that occurs in SMF 1.0 through 2.0.3. It is SMF code doing it. But when that code was written, links weren't supposed to have ! in them. Strictly speaking they're still not supposed to.

chadon

But they are so we can call it a bug. ;D

Anyways, I still don't understand why it would occur on my forums and not here. ???

Arantor

Because they've specifically patched the one line that fixes it already - a fix that never made it into the mainline SMF for 2.0.x.

It has been discussed here in the past and I'm sure someone (maybe even me) explained the fix that was needed.

chadon

I have found a topic where you participated with a related problem and a bug report but there doesn't seem to be a fix. ???
http://www.simplemachines.org/community/index.php?topic=438989.msg3243577#msg3243577

Arantor

Similar but not the one I had in mind; the change is in the same piece of code IIRC.

I wasn't able to find it with a few searches though :(

Sleezy

Quote from: chadon on January 18, 2013, 08:51:05 AM
I have been searching the forum and didn't find any topics related to my problem but I have been using SMF 2 for years and always used the "Pretty Url mod" and had problems with links being generated correctly when they contain an exclamation mark. The same happens with external links using this character.


I would like to know if this is a know bug for SMF 2 or if it's due to one of the many mods I have on my forum?


Example:
https://www.facebook.com/home.php#!/pages/page-name

I didn't even know SMF 2.0 has been out for years :P
Sorry for off topic.
SMFNew Advocate for SMFNew (Dagger)

chadon

I have been using SMF 2 since it was in beta and it has been in beta for years. ;D

chadon

No updates in this topic? ??? Can it be moved in the "Bug reports" section?

If the developers found a fix for Simplemachines' forum, they must know about it and if they thought Simplemachines needed this fix is there any reason why our forums don't deserve one?

Arantor

Because SMF 2.0.x is only receiving security fixes... and this isn't a security bug.

chadon

I just took a quick look at the change log file for SMF 2.0.3 and saw this:

QuoteCleaned up some formatting in moderation log (Modlog.php)
* Minor tweaks to stats page and profile for consistency (Stats.template.php, Profile.template.php, index.css)
*
How can it be a security fix and more important than this bug?

Anyways, my questions are about sharing the fix not waiting for someone to decide if SMF needs it or not.

Arantor

Check the 2.0.3 patch: http://custom.simplemachines.org/upgrades/index.php?action=upgrade;file=smf_patch_2.0.3.tar.gz;smf_version=2.0.2

I don't see Stats.template.php in there or Profile.template.php. And the 'cleaned up formatting' in there is a security issue.

The fix has already been shared... just need to find it (and the same goes for SMF, they'd need to find it themselves...)

chadon

Thank you Arantor, I will look for it again and share it here if I find it. :)

chadon


chadon

#27
Well, I guess there is no bug with SMF. ;D

I did a fresh install and the links are displayed properly so I will try to install the mods one by one and see wich one generates the bug and let you know.
-http://www.mustangv8.com/testforum/index.php?topic=1.0

Thank you for your time.

Arantor

Oh wait... you mean the 2.0.3 patch is different to what's in 2.0.3 fresh install?! That's fantastic.

chadon

I don't mean anything. All I understand is that SMF 2.03 with no mods works fine but maybe you understand something else? ??? ;D

Arantor

The ! thing hasn't been fixed in any of the actual patches, but if it's working in a fresh install, there's a problem.

Someone who installs 2.0 then uses the patches to go to 2.0.1, 2.0.2 and 2.0.3 etc has something different to someone installing a fresh 2.0.3 >_<

chadon

Yes but from what I see in the bug tracker, it has been fixed for SMF 2.0 and if my memory is good, there was no patch from the previous versions, it was a full upgrade.

I will try to install all the mods I have on my production sites so we'll know more about it.

Arantor

*shrug* I don't know when it was fixed - but it seems strange that it wasn't working for you initially and now it is having refreshed the files.

chadon

It's a brand new installation in an empty folder so no old files were refreshed if this is what you mean.

emanuele

Quote from: Arantor on January 19, 2013, 11:26:20 AM
*shrug* I don't know when it was fixed - but it seems strange that it wasn't working for you initially and now it is having refreshed the files.
The #! link was fixed just before final ([SiNaN] did the changes) because this kind of links were already quite popular and the fix was supposed not to break anything.

Quote from: Arantor on January 19, 2013, 11:14:35 AM
Someone who installs 2.0 then uses the patches to go to 2.0.1, 2.0.2 and 2.0.3 etc has something different to someone installing a fresh 2.0.3 >_<
I'm quite sure it's not the case (usually a patched install and a clean install are compared by diff, so *at least* the files are perfectly the same).


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

chadon

The Only mod I wasn't able to install in the test forum is Aeva Media, I will have to do some manual edits and I wasn't able to reproduce the bug with the other mods.

I tried to disable AEVA integrations on one of my production sites and the bug is still there so this mod has probably nothing to do with it. I'm lost. ???

emanuele

This is the change that should fix the issue, in Subs.php:
Code (find) Select

'~(?<=[\s>\.(;\'"]|^)((?:http|https)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',


Code (replace with) Select
'~(?<=[\s>\.(;\'"]|^)((?:http|https)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@!,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i',

Code (find) Select
'~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'
Code (replace with) Select
'~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@!,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i'

Have a look if you have the correct code in your Subs.php.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

chadon

Thank you very much Emanuele for your help but the "replace with" code is already in my Subs.php file. ???

emanuele

It's indeed AEVA (tested on a clean forum).

AEVA puts the url tag around any link (AFAIR), but probably it doesn't recognize the #! thing.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

chadon

#39
You are right Emanuele. I just installed AEVA Media on my test forum and the bug appeared, I tried to replace it with AEVA LITE and same thing.

Thank you again for your help, the mystery is now resolved. :)

Advertisement: