Geeklog-Plugins / forum

Geeklog Forum Plugin (forum)
1 stars 2 forks source link

Autotags can get corrupted by the forum text parser before they can get executed #60

Closed eSilverStrike closed 4 years ago

eSilverStrike commented 5 years ago

In gf_format.php the function gf_formatTextBlock formats the forum post in text or html mode for a number of things including smiles, bbcode and autotags.

The problem is the autotags can get corrupted by for example by a smilie code since it is run first and the parser doesn't know to stay out of the autotag string.

We could parse the autotags before the other stuff but then that means the autotag code returned can then itself get parsed by the other stuff creating it's own set of problems.

Not sure what to do here. We ideal solution is to prevent text getting parsed and formatted within a valid autotag like [story:storyid Title here] to prevent any corruption. Not sure how easy this is to do...

OR Maybe just include a warning in the docs stating that autotags can get corrupted and not run correctly in forum posts.

eSilverStrike commented 5 years ago

An example of this would be to create a story with an id that starts with a D like Digdug.

Then stick this in a forum post [story:Digdug]

The autotag will not execute and return a link to the story since the :D in the autotag will convert to a smilie first. A way around just this issue though is to include a space after a colon like so [story: Digdug] since the autotag code will still recognize the id.

mystralkk commented 4 years ago

Fixed with change set 2054073.

eSilverStrike commented 4 years ago

Great idea for the fix!