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 (423)

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.

system/helpers/string_helper.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
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 71 and the first side effect is on line 38.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * CodeIgniter
4
 *
5
 * An open source application development framework for PHP
6
 *
7
 * This content is released under the MIT License (MIT)
8
 *
9
 * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
 * copies of the Software, and to permit persons to whom the Software is
16
 * furnished to do so, subject to the following conditions:
17
 *
18
 * The above copyright notice and this permission notice shall be included in
19
 * all copies or substantial portions of the Software.
20
 *
21
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
 * THE SOFTWARE.
28
 *
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
34
 * @link	http://codeigniter.com
35
 * @since	Version 1.0.0
36
 * @filesource
37
 */
38
defined('BASEPATH') OR exit('No direct script access allowed');
39
40
/**
41
 * CodeIgniter String Helpers
42
 *
43
 * @package		CodeIgniter
44
 * @subpackage	Helpers
45
 * @category	Helpers
46
 * @author		EllisLab Dev Team
47
 * @link		http://codeigniter.com/user_guide/helpers/string_helper.html
48
 */
49
50
// ------------------------------------------------------------------------
51
52
if ( ! function_exists('trim_slashes'))
53
{
54
	/**
55
	 * Trim Slashes
56
	 *
57
	 * Removes any leading/trailing slashes from a string:
58
	 *
59
	 * /this/that/theother/
60
	 *
61
	 * becomes:
62
	 *
63
	 * this/that/theother
64
	 *
65
	 * @todo	Remove in version 3.1+.
66
	 * @deprecated	3.0.0	This is just an alias for PHP's native trim()
67
	 *
68
	 * @param	string
69
	 * @return	string
70
	 */
71
	function trim_slashes($str)
72
	{
73
		return trim($str, '/');
74
	}
75
}
76
77
// ------------------------------------------------------------------------
78
79
if ( ! function_exists('strip_slashes'))
80
{
81
	/**
82
	 * Strip Slashes
83
	 *
84
	 * Removes slashes contained in a string or in an array
85
	 *
86
	 * @param	mixed	string or array
87
	 * @return	mixed	string or array
88
	 */
89
	function strip_slashes($str)
90
	{
91
		if ( ! is_array($str))
92
		{
93
			return stripslashes($str);
94
		}
95
96
		foreach ($str as $key => $val)
97
		{
98
			$str[$key] = strip_slashes($val);
99
		}
100
101
		return $str;
102
	}
103
}
104
105
// ------------------------------------------------------------------------
106
107
if ( ! function_exists('strip_quotes'))
108
{
109
	/**
110
	 * Strip Quotes
111
	 *
112
	 * Removes single and double quotes from a string
113
	 *
114
	 * @param	string
115
	 * @return	string
116
	 */
117
	function strip_quotes($str)
118
	{
119
		return str_replace(array('"', "'"), '', $str);
120
	}
121
}
122
123
// ------------------------------------------------------------------------
124
125
if ( ! function_exists('quotes_to_entities'))
126
{
127
	/**
128
	 * Quotes to Entities
129
	 *
130
	 * Converts single and double quotes to entities
131
	 *
132
	 * @param	string
133
	 * @return	string
134
	 */
135
	function quotes_to_entities($str)
136
	{
137
		return str_replace(array("\'","\"","'",'"'), array("&#39;","&quot;","&#39;","&quot;"), $str);
138
	}
139
}
140
141
// ------------------------------------------------------------------------
142
143
if ( ! function_exists('reduce_double_slashes'))
144
{
145
	/**
146
	 * Reduce Double Slashes
147
	 *
148
	 * Converts double slashes in a string to a single slash,
149
	 * except those found in http://
150
	 *
151
	 * http://www.some-site.com//index.php
152
	 *
153
	 * becomes:
154
	 *
155
	 * http://www.some-site.com/index.php
156
	 *
157
	 * @param	string
158
	 * @return	string
159
	 */
160
	function reduce_double_slashes($str)
161
	{
162
		return preg_replace('#(^|[^:])//+#', '\\1/', $str);
163
	}
164
}
165
166
// ------------------------------------------------------------------------
167
168
if ( ! function_exists('reduce_multiples'))
169
{
170
	/**
171
	 * Reduce Multiples
172
	 *
173
	 * Reduces multiple instances of a particular character.  Example:
174
	 *
175
	 * Fred, Bill,, Joe, Jimmy
176
	 *
177
	 * becomes:
178
	 *
179
	 * Fred, Bill, Joe, Jimmy
180
	 *
181
	 * @param	string
182
	 * @param	string	the character you wish to reduce
183
	 * @param	bool	TRUE/FALSE - whether to trim the character from the beginning/end
184
	 * @return	string
185
	 */
186
	function reduce_multiples($str, $character = ',', $trim = FALSE)
187
	{
188
		$str = preg_replace('#'.preg_quote($character, '#').'{2,}#', $character, $str);
189
		return ($trim === TRUE) ? trim($str, $character) : $str;
190
	}
191
}
192
193
// ------------------------------------------------------------------------
194
195
if ( ! function_exists('random_string'))
196
{
197
	/**
198
	 * Create a Random String
199
	 *
200
	 * Useful for generating passwords or hashes.
201
	 *
202
	 * @param	string	type of random string.  basic, alpha, alnum, numeric, nozero, unique, md5, encrypt and sha1
203
	 * @param	int	number of characters
204
	 * @return	string
205
	 */
206
	function random_string($type = 'alnum', $len = 8)
207
	{
208
		switch ($type)
209
		{
210
			case 'basic':
211
				return mt_rand();
212
			case 'alnum':
213
			case 'numeric':
214
			case 'nozero':
215
			case 'alpha':
216
				switch ($type)
217
				{
218
					case 'alpha':
219
						$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
220
						break;
221
					case 'alnum':
222
						$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
223
						break;
224
					case 'numeric':
225
						$pool = '0123456789';
226
						break;
227
					case 'nozero':
228
						$pool = '123456789';
229
						break;
230
				}
231
				return substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len);
232
			case 'unique': // todo: remove in 3.1+
233
			case 'md5':
234
				return md5(uniqid(mt_rand()));
235
			case 'encrypt': // todo: remove in 3.1+
236
			case 'sha1':
237
				return sha1(uniqid(mt_rand(), TRUE));
238
		}
239
	}
240
}
241
242
// ------------------------------------------------------------------------
243
244
if ( ! function_exists('increment_string'))
245
{
246
	/**
247
	 * Add's _1 to a string or increment the ending number to allow _2, _3, etc
248
	 *
249
	 * @param	string	required
250
	 * @param	string	What should the duplicate number be appended with
251
	 * @param	string	Which number should be used for the first dupe increment
252
	 * @return	string
253
	 */
254
	function increment_string($str, $separator = '_', $first = 1)
255
	{
256
		preg_match('/(.+)'.preg_quote($separator, '/').'([0-9]+)$/', $str, $match);
257
		return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first;
258
	}
259
}
260
261
// ------------------------------------------------------------------------
262
263
if ( ! function_exists('alternator'))
264
{
265
	/**
266
	 * Alternator
267
	 *
268
	 * Allows strings to be alternated. See docs...
269
	 *
270
	 * @param	string (as many parameters as needed)
271
	 * @return	string
272
	 */
273
	function alternator()
274
	{
275
		static $i;
276
277
		if (func_num_args() === 0)
278
		{
279
			$i = 0;
280
			return '';
281
		}
282
283
		$args = func_get_args();
284
		return $args[($i++ % count($args))];
285
	}
286
}
287
288
// ------------------------------------------------------------------------
289
290
if ( ! function_exists('repeater'))
291
{
292
	/**
293
	 * Repeater function
294
	 *
295
	 * @todo	Remove in version 3.1+.
296
	 * @deprecated	3.0.0	This is just an alias for PHP's native str_repeat()
297
	 *
298
	 * @param	string	$data	String to repeat
299
	 * @param	int	$num	Number of repeats
300
	 * @return	string
301
	 */
302
	function repeater($data, $num = 1)
303
	{
304
		return ($num > 0) ? str_repeat($data, $num) : '';
305
	}
306
}
307