Issues (3627)

index_dev.php (1 issue)

1
<?php
2
3
/*
4
 * @copyright   2014 Mautic, NP
5
 * @author      Mautic
6
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
7
 */
8
define('MAUTIC_ROOT_DIR', __DIR__);
9
10
// Fix for hosts that do not have date.timezone set, it will be reset based on users settings
11
date_default_timezone_set('UTC');
12
13
require_once __DIR__.'/vendor/autoload.php';
14
15
use Mautic\CoreBundle\ErrorHandler\ErrorHandler;
16
use Mautic\Middleware\MiddlewareBuilder;
17
use function Stack\run;
18
19
if (extension_loaded('apcu') && in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1', '172.17.0.1'])) {
20
    @apcu_clear_cache();
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition for apcu_clear_cache(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unhandled  annotation

20
    /** @scrutinizer ignore-unhandled */ @apcu_clear_cache();

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
21
}
22
23
ErrorHandler::register('dev');
24
25
run((new MiddlewareBuilder(new AppKernel('dev', true)))->resolve());
26