Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 01:10 am EST

Geeklog Forums

Stop allow html comments


Status: offline

NeoNecro

Forum User
Regular Poster
Registered: 02/07/04
Posts: 90
Hello,

How can I allow html comments in stories? I tried adding !-- to the list of allowed html, but it keeps removing it. Does anybody tried this before or has an idea on how to do this?

I wan't to do this because I want to add google ads into some stories. So, when somebody reads a story by using the "read more" link they will see an ad-block in the story. It also allows me to position the block were ever I want it into the story.

Grtz
dimis-site.be
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
There's a hard-coded filter for HTML comments in COM_checkHTML. Not sure if it's still needed, but there was a reason for this at one point ...

bye, Dirk
 Quote

Status: offline

NeoNecro

Forum User
Regular Poster
Registered: 02/07/04
Posts: 90
Thanks Dirk,

So, I searched the internet for a way solve it. On php.net on the strip_tags page I found a solution posted by Isaac Schlueter.

So, I replaced to code on line 3308 of lib-common (latest version 1.3.11sr1) with this code:
Text Formatted Code
$str = str_replace(array('<!--', '-->'), array('&lt;!--', '--&gt;'), $str);
 

Then I went down a little bit until the point where it returns the data on line 3336, there I replaced:
Text Formatted Code
return $filter->Parse( $str );
 

with:
Text Formatted Code
$str = $filter->Parse( $str );
return str_replace(array('&lt;!--', '--&gt;'), array('<!--', '-->'), $str);
 

And now it works Cool
I don't think this would create a new problem. Unless your trying to post the thml equivelant of the comment like this:
Text Formatted Code
&lt;!-- -&gt;
 

Then you would end up with real comments.

Maybe this is something to include into the future versions of Geeklog?

Grtz
dimis-site.be
 Quote

All times are EST. The time is now 01:10 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content