Issues (3099)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

AdminBundle/Helper/DomainConfiguration.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
3
namespace Kunstmaan\AdminBundle\Helper;
4
5
use Symfony\Component\DependencyInjection\ContainerInterface;
6
use Symfony\Component\HttpFoundation\RequestStack;
7
8
/**
9
 * Class DomainConfiguration
10
 *
11
 * Default (single domain) configuration handling
12
 */
13
class DomainConfiguration implements DomainConfigurationInterface
14
{
15
    /** @var ContainerInterface */
16
    protected $container;
17
18
    /** @var RequestStack */
19
    private $requestStack;
20
21
    /** @var bool */
22
    protected $multiLanguage;
23
24
    /** @var array */
25
    protected $requiredLocales;
26
27
    /** @var string */
28
    protected $defaultLocale;
29
30
    /**
31
     * @param ContainerInterface|string $multilanguage
32
     */
33 43 View Code Duplication
    public function __construct(/*ContainerInterface|RequestStack*/ $requestStack, $multilanguage = null, $defaultLocale = null, $requiredLocales = null)
34
    {
35 43
        if ($requestStack instanceof ContainerInterface) {
36
            @trigger_error('Container injection and the usage of the container is deprecated in KunstmaanNodeBundle 5.1 and will be removed in KunstmaanNodeBundle 6.0.', E_USER_DEPRECATED);
37
38
            $this->container = $requestStack;
39
            $this->multiLanguage = $this->container->getParameter('kunstmaan_admin.multi_language');
40
            $this->defaultLocale = $this->container->getParameter('kunstmaan_admin.default_locale');
41
            $this->requiredLocales = explode('|', $this->container->getParameter('kunstmaan_admin.required_locales'));
42
            $this->requestStack = $this->container->get('request_stack');
43
44
            return;
45
        }
46
47 43
        $this->requestStack = $requestStack;
48 43
        $this->multiLanguage = $multilanguage;
49 43
        $this->defaultLocale = $defaultLocale;
50
51 43
        $this->requiredLocales = explode('|', $requiredLocales);
52 43
    }
53
54
    /**
55
     * @return string
56
     */
57 24
    public function getHost()
58
    {
59 24
        $request = $this->getMasterRequest();
60 24
        $host = \is_null($request) ? '' : $request->getHost();
61
62 24
        return $host;
63
    }
64
65
    /**
66
     * @return array
0 ignored issues
show
Consider making the return type a bit more specific; maybe use string[].

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
67
     */
68 1
    public function getHosts()
69
    {
70 1
        return array($this->getHost());
71
    }
72
73
    /**
74
     * @return string
75
     */
76 2
    public function getDefaultLocale()
77
    {
78 2
        return $this->defaultLocale;
79
    }
80
81
    /**
82
     * @param string|null $host
83
     *
84
     * @return bool
85
     */
86 3
    public function isMultiLanguage($host = null)
87
    {
88 3
        return $this->multiLanguage;
89
    }
90
91
    /**
92
     * @param string|null $host
93
     *
94
     * @return array
95
     */
96 2
    public function getFrontendLocales($host = null)
97
    {
98 2
        return $this->requiredLocales;
99
    }
100
101
    /**
102
     * @param string|null $host
103
     *
104
     * @return array
105
     */
106 4
    public function getBackendLocales($host = null)
107
    {
108 4
        return $this->requiredLocales;
109
    }
110
111
    /**
112
     * @return bool
113
     */
114 1
    public function isMultiDomainHost()
115
    {
116 1
        return false;
117
    }
118
119
    /**
120
     * @param string|null $host
121
     */
122 2
    public function getRootNode($host = null)
123
    {
124 2
        return null;
125
    }
126
127
    /**
128
     * @return array
129
     */
130 2
    public function getExtraData()
131
    {
132 2
        return array();
133
    }
134
135
    /**
136
     * @return array
137
     */
138 2
    public function getLocalesExtraData()
139
    {
140 2
        return array();
141
    }
142
143
    /**
144
     * @return \Symfony\Component\HttpFoundation\Request|null
145
     */
146 29
    protected function getMasterRequest()
147
    {
148 29
        return $this->requestStack->getMasterRequest();
149
    }
150
151
    /**
152
     * @return array
153
     */
154 1
    public function getFullHostConfig()
155
    {
156 1
        return array();
157
    }
158
159
    /**
160
     * @param string|null $host
161
     */
162 1
    public function getFullHost($host = null)
163
    {
164 1
        return null;
165
    }
166
167
    /**
168
     * @param string|int $id
169
     */
170 1
    public function getFullHostById($id)
171
    {
172 1
        return null;
173
    }
174
175 1
    public function getHostSwitched()
176
    {
177 1
        return null;
178
    }
179
180
    /**
181
     * @param string|null $host
182
     */
183 1
    public function getHostBaseUrl($host = null)
184
    {
185 1
        return null;
186
    }
187
}
188