Menu

#677 phpAds_getBannerCache() doesn't use $quotchar for <a target=

phpAdsNew 2 rc
open
nobody
5
2007-04-12
2007-04-12
harikaram
No

SUMMARY:
phpAds_getBannerCache() uses $quotchar to intelligently write single or double quotes for the href but then uses a single quote literal to write the tag's target. attrib. This causes a delivery error with HTML banners in which the HTML code for the banner writes the A tag as a string with javascript surrounded by single quotes.

EXAMPLE:
Banner code:

document.write('<a href="http://site.com/"');

htmlcache field in _banners table upon adding banner to the phpAdsNew:

document.write('<a target='_blank' href="...

SOLUTION:
In lib-banner.inc.php lines 282-283, change:

$buffer = eregi_replace ("<a ", "<a target='{target}' ", $buffer);
$buffer = eregi_replace ("<area ", "<area target='{target}' ", $buffer);

to:

$buffer = eregi_replace ("<a ", "<a target=$quotechar{target}$quotechar ", $buffer);
$buffer = eregi_replace ("<area ", "<area target=$quotechar{target}$quotechar ", $buffer);

Hope this helps!
Harikaram

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.