| @@ 23-34 (lines=12) @@ | ||
| 20 | * There is no reason why ad would trigger alert, so it's |
|
| 21 | * categorized as warning. |
|
| 22 | */ |
|
| 23 | public function run($ad_code) |
|
| 24 | { |
|
| 25 | if (preg_match('/alert\s*\(/U', $ad_code)) |
|
| 26 | { |
|
| 27 | return array( |
|
| 28 | 'severity' => 'warning', |
|
| 29 | 'message' => 'ALERT_USAGE', |
|
| 30 | ); |
|
| 31 | } |
|
| 32 | ||
| 33 | return false; |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| @@ 23-34 (lines=12) @@ | ||
| 20 | * There is no reason why ad would redirect user to another page, |
|
| 21 | * so it's categorized as warning. |
|
| 22 | */ |
|
| 23 | public function run($ad_code) |
|
| 24 | { |
|
| 25 | if (preg_match('/location\.href(\s)*=/U', $ad_code)) |
|
| 26 | { |
|
| 27 | return array( |
|
| 28 | 'severity' => 'warning', |
|
| 29 | 'message' => 'LOCATION_CHANGE', |
|
| 30 | ); |
|
| 31 | } |
|
| 32 | ||
| 33 | return false; |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||