When using the htmlcorrector module in conjunction with the adsense-injector module, the ads were not displaying correctly as it was converting the adsense comment tags from "<" to "<"

eg:

to

<!--adsense: placeholder-->

I then ended up making the following hacks to the htmlcorrector_process function to get it to ignore comment tags:

1. commented out the below line
//$text = preg_replace('!<([^a-zA-Z/])!', '<\1', $text);

2. added the following line before " // Closing tag"

/// comment tag
if ($tagname{0} == '!') {$output .= '<'.$value.'>';$tag = !$tag;continue;}

My PHP and regex is not good, so there may be a better way to do it, but this works for me.

Comments

reggie75’s picture

Sorry, I have used better formatting to describe the bug below:

---

When using the htmlcorrector module in conjunction with the adsense-injector module, the ads were not displaying correctly as it was converting the adsense comment tags from:

 "<!" 

to

"&lt;!"

eg:

<!--adsense: placeholder-->

to

&lt;!--adsense: placeholder-->

I then ended up making the following hacks to the htmlcorrector_process function to get it to ignore comment tags:

1. commented out the below line

//$text = preg_replace('!<([^a-zA-Z/])!', '<\1', $text);

2. added the following line before " // Closing tag"

/// comment tag
if ($tagname{0} == '!') {$output .= '<'.$value.'>';$tag = !$tag;continue;}

My PHP and regex is not good, so there may be a better way to do it, but this works for me.

jcfiala’s picture

This seems to be the same as issue http://drupal.org/node/97182, isn't it?

quicksketch’s picture

Status: Active » Closed (duplicate)

Yep, same issue.