- March 2021
- February 2021
- October 2020
- June 2020
- May 2020
- October 2019
- June 2019
- September 2018
- May 2018
- December 2017
- April 2017
- June 2016
- February 2016
- November 2015
- January 2015
- August 2014
- July 2014
- May 2014
- March 2014
- February 2014
- January 2014
- November 2013
- August 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- December 2012
- November 2012
- September 2012
- June 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- September 2011
- July 2011
- June 2011
- May 2011
- March 2011
- January 2011
- October 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- September 2009
- July 2009
- June 2009
- May 2009
- March 2009
- September 2008
- April 2008
- December 2007
- June 2007
- June 2005
- September 2004
- May 2002
- October 2001
- August 2001
2012-12-03: Bugfix for handling of Flash content in OpenX
Advertising server software OpenX is reasonably user friendly to work with, but also quite insecure and buggy. One of the bugs I came across was that it misidentified Flash banners compiled with Flash version 11.4 as requiring Flash Player 17 (which doesn't exist). Since OpenX checks the version of the Flash plugin against its perceived minimum requirements, this meant that a few ads simply wouldn't display. Here's the fix to the OpenX code.
The problem lies in OpenX misinterpreting the version field in the SWF file. Up to and including version 10.1 of the Flash compiler, the 4th byte of the compiled SWF file would be the major version of the compiler. Version 10.2, however, uses the value 0x0B (decimal: 11) and subsequent minor versions have also increased the byte value. OpenX fails to take this into account.
Find the following function in www/admin/lib-swf.inc.php (relative to your OpenX base install directory):
<?php
function phpAds_SWFVersion($buffer)
{
if (substr($buffer, 0, 3) == swf_tag_identify ||
substr($buffer, 0, 3) == swf_tag_compressed)
return ord(substr($buffer, 3, 1));
else
return false;
}
?>
And change that to:
<?php
function phpAds_SWFVersion($buffer)
{
if (substr($buffer, 0, 3) == swf_tag_identify ||
substr($buffer, 0, 3) == swf_tag_compressed)
{
$rv = ord(substr($buffer, 3, 1));
if ($rv > 10 && $rv < 13) $rv = 10;
elseif ($rv >= 13 && $rv < 23) $rv = 11;
elseif ($rv >= 23) $rv -= 11;
return $rv;
} else
return false;
}
?>
That should handle SWF files built by Flash compiler versions 10.2 and later, at least up to 11.5 12.0 (the current version of Flash, at the time of writing), but may need updating when Flash 12 13 is released (if that unfortunate event ever occurs). It doesn't differentiate between minor versions, as the OpenX table structure doesn't allow for that. But then, anybody who has an older version of the Flash plugin should have their internet browsing license revoked immediately anyway.
Update (2014-03-03): updated the code to correctly identify content for Flash Player 12, according to values in the Flash Player and Air Feature List.
Update (2015-12-30): updated the code to correctly identify content for Flash Player versions 13 and later.
Comments
It works! Thanks! You should do commit to openx repository.
Thank you so much for this!!
Thank you! Saved our day!
I hope you don't mind, but i have submit this as a critical bug in openx. So that it will get officially fixed.
Thanks a lot ! :)
Graciela.
You save our day!
You're a lifesaver, thanks a looott !
This fixed the ads not showing up...
But looks like the destination url still does not work.
Banner are not clickable anymore.
This fix helps us too, Thanks !!!
Awesome!
Because of you it took me only 2 minutes to get rid of that bug.
Thanks a lot!
Thank you!
that fixed perfectly!
Life-saver stuff right there. Thank you.
Post a comment