Completed
Push — master ( 5f1ca1...a7b5ff )
by Henry
04:31
created

install.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace Redaxscript;
3
4
use function set_include_path;
5
6
/* bootstrap */
7
8
include_once('includes' . DIRECTORY_SEPARATOR . 'bootstrap.php');
9
10
/* header */
11
12
Header::init();
13
14
/* get instance */
15
16
$registry = Registry::getInstance();
17
$request = Request::getInstance();
18
$language = Language::getInstance();
19
$config = Config::getInstance();
20
21
/* load module */
22
23
$formValidator = new Modules\FormValidator\FormValidator($registry, $request, $language, $config);
24
$unmaskPassword = new Modules\UnmaskPassword\UnmaskPassword($registry, $request, $language, $config);
25
$formValidator->renderStart();
26
$unmaskPassword->renderStart();
27
28
/* restrict access */
29
30
if (!$config->get('lock'))
0 ignored issues
show
Bug Best Practice introduced by
The expression $config->get('lock') of type string|null is loosely compared to false; this is ambiguous if the string can be empty. You might want to explicitly use === null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
31
{
32
	Header::responseCode(200);
33
	set_include_path('templates');
34
	include_once('install' . DIRECTORY_SEPARATOR . 'index.phtml');
35
}
36
else
37
{
38
	Header::responseCode(403);
39
	exit(1);
40
}
41