phpbb-extensions /
ad-management
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * |
||
| 4 | * Advertisement management. An extension for the phpBB Forum Software package. |
||
| 5 | * |
||
| 6 | * @copyright (c) 2017 phpBB Limited <https://www.phpbb.com> |
||
| 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
||
| 8 | * |
||
| 9 | */ |
||
| 10 | |||
| 11 | namespace phpbb\ads\analyser\test; |
||
| 12 | |||
| 13 | class untrusted_connection implements test_interface |
||
| 14 | { |
||
| 15 | /** @var \phpbb\request\request */ |
||
|
0 ignored issues
–
show
|
|||
| 16 | protected $request; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Construct an ad code analysis manager object |
||
| 20 | * |
||
| 21 | * @param \phpbb\request\request $request Request object |
||
| 22 | */ |
||
| 23 | 13 | public function __construct(\phpbb\request\request $request) |
|
| 24 | { |
||
| 25 | 13 | $this->request = $request; |
|
| 26 | 13 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritDoc} |
||
| 30 | * |
||
| 31 | * Untrusted connection test. |
||
| 32 | * When board runs on HTTPS and ad tries to load a file from |
||
| 33 | * HTTP source, browser throws a warning. We should prevent that. |
||
| 34 | */ |
||
| 35 | 13 | public function run($ad_code) |
|
| 36 | { |
||
| 37 | 13 | $is_https = $this->request->server('HTTPS', false); |
|
| 38 | 13 | if ($is_https && preg_match('/http[^s]/', $ad_code)) |
|
| 39 | 13 | { |
|
| 40 | return array( |
||
| 41 | 2 | 'severity' => 'warning', |
|
| 42 | 2 | 'message' => 'UNSECURE_CONNECTION', |
|
| 43 | 2 | ); |
|
| 44 | } |
||
| 45 | |||
| 46 | 11 | return false; |
|
| 47 | } |
||
| 48 | } |
||
| 49 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths