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.

src/Kunstmaan/AdminListBundle/AdminList/Field.php (2 issues)

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\AdminListBundle\AdminList;
4
5
use Symfony\Component\PropertyAccess\PropertyAccess;
6
7
/**
8
 * Field
9
 */
10
class Field
11
{
12
    /**
13
     * @var string
14
     */
15
    private $header;
16
17
    /**
18
     * @var string
19
     */
20
    private $name;
21
22
    /**
23
     * @var bool
24
     */
25
    private $sort;
26
27
    /**
28
     * @var string|null
29
     */
30
    private $template;
31
32
    /**
33
     * @var FieldAlias|null
34
     */
35
    private $alias;
36
37
    /**
38
     * @param string     $name     The name
39
     * @param string     $header   The header
40
     * @param bool       $sort     Sort or not
41
     * @param string     $template The template
42
     * @param FieldAlias $alias    The alias
0 ignored issues
show
Should the type for parameter $alias not be null|FieldAlias?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
43
     */
44 20
    public function __construct($name, $header, $sort = false, $template = null, FieldAlias $alias = null)
45
    {
46 20
        $this->name = $name;
47 20
        $this->header = $header;
48 20
        $this->sort = $sort;
49 20
        $this->template = $template;
50 20
        $this->alias = $alias;
51 20
    }
52
53
    /**
54
     * @return string
55
     */
56 5
    public function getName()
57
    {
58 5
        return $this->name;
59
    }
60
61
    /**
62
     * @return string
63
     */
64 3
    public function getHeader()
65
    {
66 3
        return $this->header;
67
    }
68
69
    /**
70
     * @return bool
71
     */
72 5
    public function isSortable()
73
    {
74 5
        return $this->sort;
75
    }
76
77
    /**
78
     * @return string
79
     */
80 3
    public function getTemplate()
81
    {
82 3
        return $this->template;
83
    }
84
85
    /**
86
     * @return FieldAlias|null
87
     */
88 2
    public function getAlias()
89
    {
90 2
        return $this->alias;
91
    }
92
93
    /**
94
     * @return bool
95
     */
96 1
    public function hasAlias()
97
    {
98 1
        if (\is_null($this->alias)) {
99 1
            return false;
100
        }
101
102 1
        return true;
103
    }
104
105 1
    public function getAliasObj($item)
106
    {
107 1
        $relation = $this->alias->getRelation();
108 1
        $accessor = PropertyAccess::createPropertyAccessor();
109
110 1
        if ($accessor->isReadable($item, $relation)) {
111 1
            $item = $accessor->getValue($item, $relation);
112
        }
113
114 1
        return $item;
115
    }
116
117 1
    public function getColumnName($column)
0 ignored issues
show
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
118
    {
119 1
        $abbr = $this->alias->getAbbr().'.';
120
121 1
        if (strpos($column, $abbr) !== false) {
122 1
            $column = str_replace($abbr, '', $column);
123
        } else {
124 1
            throw new \Exception(" '".$abbr."' can not be found in your column name: '".$column."' ");
125
        }
126
127 1
        return $column;
128
    }
129
}
130