for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
*
* Advertisement management. An extension for the phpBB Forum Software package.
* @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*/
namespace phpbb\ads\analyser\test;
class script_without_async implements test_interface
{
* {@inheritDoc}
public function test($ad_code)
if (preg_match_all('/<script(.*)>/U', $ad_code, $matches))
foreach ($matches[1] as $match)
if (!preg_match('/ async/', $match))
return array(
'notice' => array(
'SCRIPT_WITHOUT_ASYNC',
),
);
}
return array();