Url's in comments

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

Url's in comments

Postby verbaljam » Sat Apr 16, 2011 4:20 pm

I noticed a small glitch in the way the comment form handles url's.
In a url that contains spaces, the space character normally is substituted by a %20.
Pivot seems to filter out that %20.
So an url like
Code: Select all
http://www.hernehim.nl/blog%20en%20proza.htm
loses the %20 character and becomes invalid.
This way commenters cannot refer to url's that contain spaces.
If you read Dutch, you read Verbal Jam.
Lack of documentation makes even the best program useless...
verbaljam
 
Posts: 143
Joined: Thu Apr 22, 2010 8:32 am
Location: Amsterdam

Re: Url's in comments

Postby hansfn » Sun Apr 17, 2011 6:47 am

Spaces in URLs are ugly ;-) Does the same happen if you use +?
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Url's in comments

Postby verbaljam » Sun Apr 17, 2011 3:54 pm

I agree. But how exactly do you want me to use the +? Instead of %?
I tried:
Code: Select all
http://www.hernehim.nl/blog+20en+20proza.htm
or:
http://www.hernehim.nl/blog+en+proza.htm

This remains as I typed it.
If you read Dutch, you read Verbal Jam.
Lack of documentation makes even the best program useless...
verbaljam
 
Posts: 143
Joined: Thu Apr 22, 2010 8:32 am
Location: Amsterdam

Re: Url's in comments

Postby hansfn » Sun Apr 17, 2011 6:47 pm

I meant using plus instead of the space (or %20 if the URL is already encoded), but reading the specs closer it seems it's only allowed to use plus for spaces in the query part of the URL.

Anyway, what you have discovered is a bug in PivotX. We'll fix it some time .. Maybe soon, if I get time for it.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Url's in comments

Postby Bob » Fri Apr 22, 2011 10:05 am

I'll commit a patch to SVN in a few minutes. This will be in 2.2.6.

If you'd like to fix it right now, edit pivotx/modules/module_smarty.php, line 1250:

Code: Select all
$this_tag = preg_replace("/%[a-z0-9]+%/", "", $commentinfo['format']);
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Url's in comments

Postby hansfn » Mon Apr 25, 2011 6:31 am

Bob, that change doesn't fix anything - the URL is still changed from

Code: Select all
http://www.hernehim.nl/blog%20en%20proza.htm

to

Code: Select all
http://www.hernehim.nl/blog20proza.htm


I think the only viable fix is to remove line 1250. (It must be the responsibility of the comment_after_parse hook to remove any extra formatting tags that are defined by the the hook.)
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Url's in comments

Postby Bob » Tue Apr 26, 2011 1:26 pm

You're right. my fix only works when there's only one %20 in a single URL. I'll remove line 1250, to fix it.
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm


Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 11 guests

cron