URL strings parsing in Comments section

All suggestions about TPFC should be posted here. Discussions about changes to TPFC will also be carried out here.
Post Reply
Message
Author
User avatar
__philippe
Posts: 687
Joined: Wed Jun 26, 2013 2:09 am

URL strings parsing in Comments section

#1 Post by __philippe »

Came accross an oddity trying to submit a comment including an URL pointing to a specific post number (as opposed to a mere topic number):

For instance, this URL string entered in the "Post your Comment" box :
will be parsed thus in the actual comment entry :
(The post# substring gets effectively cut off from the original full URL string)

Any way to circumvent this apparent glitch?

__philippe

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: URL strings parsing in Comments section

#2 Post by Midas »

It's a known limitation of the commenting URL parsing, although I never noticed the insertion of a blank spaces ("%20"). Notwithstanding, the usual way of achieving your intended goal is by referencing a post thusly: http://www.portablefreeware.com/forums/ ... 791#p74791 -- you can test it by clicking on the tiny document icon immediately before the "Posted:" string present in the the top right corner of every post... :roll:

User avatar
__philippe
Posts: 687
Joined: Wed Jun 26, 2013 2:09 am

Re: URL strings parsing in Comments section

#3 Post by __philippe »

@Midas...Thanks for the prompt reply.

However, your suggestion does not seem to work for posting within the Comments section.
(Yet, it works just fine for Forum posts)

The sample URL gets parsed as illustrated below in a Comments entry:
Notice the terminating substring #p74791 is displayed alright, but NOT included within the underlined URL part,
and, consequently, the URL points to the first Post of the Topic, instead of the intended specific Post#. :roll:


Image

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: URL strings parsing in Comments section

#4 Post by Midas »

__philippe wrote:Notice the terminating substring #p74791 is displayed alright, but NOT included within the underlined URL part,
and, consequently, the URL points to the first Post of the Topic, instead of the intended specific Post#.
  • Precisely. As I told you, a known limitation of the commenting engine ("#" breaks the URL; you might want to try replacing it with "%23")... :P

User avatar
__philippe
Posts: 687
Joined: Wed Jun 26, 2013 2:09 am

Re: URL strings parsing in Comments section

#5 Post by __philippe »

Guess there must be some compelling (historical ?) rationale to let the URL parser choke on "#" in the Comments section
(while the very same "#" character is gobbled without a hiccup in the Forums)... :?:

Bug or feature ?...that is the question ...;-)

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: URL strings parsing in Comments section

#6 Post by Midas »

Forum is phpBB based, a rather well established foruming brand; the site and database are privately grown -- mainly by Mr. Lee, with cosmetic help by tproli... :idea:

Since we're discussing it, I can't help but wonder if, had TPFC site software been open-sourced as a software oriented CMS, and consequently committed to a repository, that one bug, as well as any others, wouldn't have been corrected already by independent input...

User avatar
Andrew Lee
Posts: 3063
Joined: Sat Feb 04, 2006 9:19 am
Contact:

Re: URL strings parsing in Comments section

#7 Post by Andrew Lee »

Bug or feature ?...that is the question ...;-)
I wouldn't call it a bug, just an oversight :lol: Anyway, I have fixed the bug, which thankfully was relatively straightforward (adding '#' to the regex for URL parsing).
Since we're discussing it, I can't help but wonder if, had TPFC site software been open-sourced as a software oriented CMS, and consequently committed to a repository, that one bug, as well as any others, wouldn't have been corrected already by independent input...
If any of you are interested in the source code, drop me a PM. I have send it out at least once, but I am not sure if it has actually been deployed elsewhere since I didn't get any feedback.

Anyway, the TPFC system can only be classified as a CMS in the narrowest sense. It is just too specific for its purpose and not really extendable. Remember, I did it as a programming exercise to learn PHP, and it just grew organically. I wouldn't say I am very proud of the code. It could be much better. :oops:

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: URL strings parsing in Comments section

#8 Post by Midas »

Andrew Lee wrote:I wouldn't say I am very proud of the code. It could be much better. :oops:
  • Famous coder last words... :mrgreen:

User avatar
tproli
Posts: 1172
Joined: Sat Sep 09, 2006 10:14 am
Location: Hungary
Contact:

Re: URL strings parsing in Comments section

#9 Post by tproli »

No, this one sounds more so :)
Andrew Lee wrote:I wouldn't call it a bug

User avatar
__philippe
Posts: 687
Joined: Wed Jun 26, 2013 2:09 am

Re: URL strings parsing in Comments section

#10 Post by __philippe »

Andrew Lee wrote:... I wouldn't call it a bug, just an oversight :lol: Anyway, I have fixed the bug, which thankfully was relatively straightforward (adding '#' to the regex for URL parsing).
Great, Andrew!
Thanks for the fix (...second try's the charm...;-) )
... Remember, I did it as a programming exercise to learn PHP, and it just grew organically. I wouldn't say I am very proud of the code. It could be much better. :oops:
Ego te absolvo...Go in peace, my son, and sin no more... :lol:

Cheers,

__philippe

User avatar
Midas
Posts: 6725
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: URL strings parsing in Comments section

#11 Post by Midas »

tproli wrote:No, this one sounds more so :)
Andrew Lee wrote:I wouldn't call it a bug
  • Yep, I thought of it more like a TPFC feature, really... :twisted:
__philippe wrote:Ego te absolvo...Go in peace, my son, and sin no more... :lol:
  • Amen. :)

Post Reply