GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (107)

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/helpers/TbArray.php (2 issues)

Severity

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
 * TbArray class file.
4
 * @author Christoffer Niska <[email protected]>
5
 * @copyright Copyright &copy; Christoffer Niska 2013-
6
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
7
 * @package bootstrap.helpers
8
 */
9
10
/**
11
 * Array helper class.
12
 */
13
class TbArray
14
{
15
    /**
16
     * Returns a specific value from the given array (or the default value if not set).
17
     * @param string $key the item key.
18
     * @param array $array the array to get from.
19
     * @param mixed $defaultValue the default value.
20
     * @return mixed the value.
21
     */
22
    public static function getValue($key, array $array, $defaultValue = null)
23
    {
24
        return isset($array[$key]) ? $array[$key] : $defaultValue;
25
    }
26
27
    /**
28
     * Removes and returns a specific value from the given array (or the default value if not set).
29
     * @param string $key the item key.
30
     * @param array $array the array to pop the item from.
31
     * @param mixed $defaultValue the default value.
32
     * @return mixed the value.
33
     */
34
    public static function popValue($key, array &$array, $defaultValue = null)
35
    {
36
        $value = self::getValue($key, $array, $defaultValue);
37
        unset($array[$key]);
38
        return $value;
39
    }
40
41
    /**
42
     * Sets the default value for a specific key in the given array.
43
     * @param string $key the item key.
44
     * @param mixed $value the default value.
45
     * @param array $array the array.
46
     */
47
    public static function defaultValue($key, $value, array &$array)
48
    {
49
        if (!isset($array[$key])) {
50
            $array[$key] = $value;
51
        }
52
    }
53
54
    /**
55
     * Sets a set of default values for the given array.
56
     * @param array $array the array to set values for.
57
     * @param array $values the default values.
58
     */
59
    public static function defaultValues(array $values, array &$array)
60
    {
61
        foreach ($values as $name => $value) {
62
            self::defaultValue($name, $value, $array);
63
        }
64
    }
65
66
    /**
67
     * Removes a specific value from the given array.
68
     * @param string $key the item key.
69
     */
70
    public static function removeValue($key, array &$array)
71
    {
72
        unset($array[$key]);
73
    }
74
75
    /**
76
     * Removes a set of items from the given array.
77
     * @param string[] $keys the keys to remove.
78
     * @param array $array the array to remove from.
79
     */
80
    public static function removeValues(array $keys, array &$array)
81
    {
82
        $array = array_diff_key($array, array_flip($keys));
83
    }
84
85
    /**
86
     * Copies the given values from one array to another.
87
     * @param string[] $keys the keys to copy.
88
     * @param array $from the array to copy from.
89
     * @param array $to the array to copy to.
90
     * @param boolean $force whether to allow overriding of existing values.
91
     * @return array the options.
92
     */
93
    public static function copyValues(array $keys, array $from, array $to, $force = false)
94
    {
95
        foreach ($keys as $key) {
96
            if (isset($from[$key])) {
97
                if ($force || !isset($to[$key])) {
98
                    $to[$key] = self::getValue($key, $from);
99
                }
100
            }
101
        }
102
        return $to;
103
    }
104
105
    /**
106
     * Moves the given values from one array to another.
107
     * @param array $keys the keys to move.
108
     * @param array $from the array to move from.
109
     * @param array $to the array to move to.
110
     * @param boolean $force whether to allow overriding of existing values.
111
     * @return array the options.
112
     */
113
    public static function moveValues(array $keys, array &$from, array $to, $force = false)
114
    {
115
        foreach ($keys as $key) {
116
            if (isset($from[$key])) {
117
                $value = self::popValue($key, $from);
118
                if ($force || !isset($to[$key])) {
119
                    $to[$key] = $value;
120
                    unset($from[$key]);
121
                }
122
            }
123
        }
124
        return $to;
125
    }
126
127
    /**
128
     * Merges two arrays.
129
     * @param array $to array to be merged to.
130
     * @param array $from array to be merged from.
131
     * @return array the merged array.
132
     */
133
    public static function merge(array $to, array $from)
0 ignored issues
show
The parameter $to is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $from is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
134
    {
135
        $args = func_get_args();
136
        $res = array_shift($args);
137
        while (!empty($args)) {
138
            $next = array_shift($args);
139
            foreach ($next as $k => $v) {
140
                if (is_integer($k)) {
141
                    isset($res[$k]) ? $res[] = $v : $res[$k] = $v;
142
                } elseif (is_array($v) && isset($res[$k]) && is_array($res[$k])) {
143
                    $res[$k] = self::merge($res[$k], $v);
144
                } else {
145
                    $res[$k] = $v;
146
                }
147
            }
148
        }
149
        return $res;
150
    }
151
}