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/html_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 64 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 HTML Helpers
42
 *
43
 * @package		CodeIgniter
44
 * @subpackage	Helpers
45
 * @category	Helpers
46
 * @author		EllisLab Dev Team
47
 * @link		http://codeigniter.com/user_guide/helpers/html_helper.html
48
 */
49
50
// ------------------------------------------------------------------------
51
52
if ( ! function_exists('heading'))
53
{
54
	/**
55
	 * Heading
56
	 *
57
	 * Generates an HTML heading tag.
58
	 *
59
	 * @param	string	content
60
	 * @param	int	heading level
61
	 * @param	string
62
	 * @return	string
63
	 */
64
	function heading($data = '', $h = '1', $attributes = '')
65
	{
66
		return '<h'.$h._stringify_attributes($attributes).'>'.$data.'</h'.$h.'>';
67
	}
68
}
69
70
// ------------------------------------------------------------------------
71
72
if ( ! function_exists('ul'))
73
{
74
	/**
75
	 * Unordered List
76
	 *
77
	 * Generates an HTML unordered list from an single or multi-dimensional array.
78
	 *
79
	 * @param	array
80
	 * @param	mixed
81
	 * @return	string
82
	 */
83
	function ul($list, $attributes = '')
84
	{
85
		return _list('ul', $list, $attributes);
86
	}
87
}
88
89
// ------------------------------------------------------------------------
90
91
if ( ! function_exists('ol'))
92
{
93
	/**
94
	 * Ordered List
95
	 *
96
	 * Generates an HTML ordered list from an single or multi-dimensional array.
97
	 *
98
	 * @param	array
99
	 * @param	mixed
100
	 * @return	string
101
	 */
102
	function ol($list, $attributes = '')
103
	{
104
		return _list('ol', $list, $attributes);
105
	}
106
}
107
108
// ------------------------------------------------------------------------
109
110
if ( ! function_exists('_list'))
111
{
112
	/**
113
	 * Generates the list
114
	 *
115
	 * Generates an HTML ordered list from an single or multi-dimensional array.
116
	 *
117
	 * @param	string
118
	 * @param	mixed
119
	 * @param	mixed
120
	 * @param	int
121
	 * @return	string
122
	 */
123
	function _list($type = 'ul', $list = array(), $attributes = '', $depth = 0)
124
	{
125
		// If an array wasn't submitted there's nothing to do...
126
		if ( ! is_array($list))
127
		{
128
			return $list;
129
		}
130
131
		// Set the indentation based on the depth
132
		$out = str_repeat(' ', $depth)
133
			// Write the opening list tag
134
			.'<'.$type._stringify_attributes($attributes).">\n";
135
136
137
		// Cycle through the list elements.  If an array is
138
		// encountered we will recursively call _list()
139
140
		static $_last_list_item = '';
141
		foreach ($list as $key => $val)
142
		{
143
			$_last_list_item = $key;
144
145
			$out .= str_repeat(' ', $depth + 2).'<li>';
146
147
			if ( ! is_array($val))
148
			{
149
				$out .= $val;
150
			}
151
			else
152
			{
153
				$out .= $_last_list_item."\n"._list($type, $val, '', $depth + 4).str_repeat(' ', $depth + 2);
154
			}
155
156
			$out .= "</li>\n";
157
		}
158
159
		// Set the indentation for the closing tag and apply it
160
		return $out.str_repeat(' ', $depth).'</'.$type.">\n";
161
	}
162
}
163
164
// ------------------------------------------------------------------------
165
166
if ( ! function_exists('img'))
167
{
168
	/**
169
	 * Image
170
	 *
171
	 * Generates an <img /> element
172
	 *
173
	 * @param	mixed
174
	 * @param	bool
175
	 * @param	mixed
176
	 * @return	string
177
	 */
178
	function img($src = '', $index_page = FALSE, $attributes = '')
179
	{
180
		if ( ! is_array($src) )
181
		{
182
			$src = array('src' => $src);
183
		}
184
185
		// If there is no alt attribute defined, set it to an empty string
186
		if ( ! isset($src['alt']))
187
		{
188
			$src['alt'] = '';
189
		}
190
191
		$img = '<img';
192
193
		foreach ($src as $k => $v)
194
		{
195
			if ($k === 'src' && ! preg_match('#^([a-z]+:)?//#i', $v))
196
			{
197
				if ($index_page === TRUE)
198
				{
199
					$img .= ' src="'.get_instance()->config->site_url($v).'"';
200
				}
201
				else
202
				{
203
					$img .= ' src="'.get_instance()->config->slash_item('base_url').$v.'"';
204
				}
205
			}
206
			else
207
			{
208
				$img .= ' '.$k.'="'.$v.'"';
209
			}
210
		}
211
212
		return $img._stringify_attributes($attributes).' />';
213
	}
214
}
215
216
// ------------------------------------------------------------------------
217
218
if ( ! function_exists('doctype'))
219
{
220
	/**
221
	 * Doctype
222
	 *
223
	 * Generates a page document type declaration
224
	 *
225
	 * Examples of valid options: html5, xhtml-11, xhtml-strict, xhtml-trans,
226
	 * xhtml-frame, html4-strict, html4-trans, and html4-frame.
227
	 * All values are saved in the doctypes config file.
228
	 *
229
	 * @param	string	type	The doctype to be generated
230
	 * @return	string
231
	 */
232
	function doctype($type = 'xhtml1-strict')
233
	{
234
		static $doctypes;
235
236 View Code Duplication
		if ( ! is_array($doctypes))
237
		{
238
			if (file_exists(APPPATH.'config/doctypes.php'))
239
			{
240
				include(APPPATH.'config/doctypes.php');
241
			}
242
243
			if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php'))
244
			{
245
				include(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php');
246
			}
247
248
			if (empty($_doctypes) OR ! is_array($_doctypes))
249
			{
250
				$doctypes = array();
251
				return FALSE;
252
			}
253
254
			$doctypes = $_doctypes;
255
		}
256
257
		return isset($doctypes[$type]) ? $doctypes[$type] : FALSE;
258
	}
259
}
260
261
// ------------------------------------------------------------------------
262
263
if ( ! function_exists('link_tag'))
264
{
265
	/**
266
	 * Link
267
	 *
268
	 * Generates link to a CSS file
269
	 *
270
	 * @param	mixed	stylesheet hrefs or an array
271
	 * @param	string	rel
272
	 * @param	string	type
273
	 * @param	string	title
274
	 * @param	string	media
275
	 * @param	bool	should index_page be added to the css path
276
	 * @return	string
277
	 */
278
	function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
279
	{
280
		$CI =& get_instance();
281
		$link = '<link ';
282
283
		if (is_array($href))
284
		{
285
			foreach ($href as $k => $v)
286
			{
287
				if ($k === 'href' && ! preg_match('#^([a-z]+:)?//#i', $v))
288
				{
289
					if ($index_page === TRUE)
290
					{
291
						$link .= 'href="'.$CI->config->site_url($v).'" ';
292
					}
293
					else
294
					{
295
						$link .= 'href="'.$CI->config->slash_item('base_url').$v.'" ';
296
					}
297
				}
298
				else
299
				{
300
					$link .= $k.'="'.$v.'" ';
301
				}
302
			}
303
		}
304
		else
305
		{
306
			if (preg_match('#^([a-z]+:)?//#i', $href))
307
			{
308
				$link .= 'href="'.$href.'" ';
309
			}
310
			elseif ($index_page === TRUE)
311
			{
312
				$link .= 'href="'.$CI->config->site_url($href).'" ';
313
			}
314
			else
315
			{
316
				$link .= 'href="'.$CI->config->slash_item('base_url').$href.'" ';
317
			}
318
319
			$link .= 'rel="'.$rel.'" type="'.$type.'" ';
320
321
			if ($media !== '')
322
			{
323
				$link .= 'media="'.$media.'" ';
324
			}
325
326
			if ($title !== '')
327
			{
328
				$link .= 'title="'.$title.'" ';
329
			}
330
		}
331
332
		return $link."/>\n";
333
	}
334
}
335
336
// ------------------------------------------------------------------------
337
338
if ( ! function_exists('meta'))
339
{
340
	/**
341
	 * Generates meta tags from an array of key/values
342
	 *
343
	 * @param	array
344
	 * @param	string
345
	 * @param	string
346
	 * @param	string
347
	 * @return	string
348
	 */
349
	function meta($name = '', $content = '', $type = 'name', $newline = "\n")
350
	{
351
		// Since we allow the data to be passes as a string, a simple array
352
		// or a multidimensional one, we need to do a little prepping.
353
		if ( ! is_array($name))
354
		{
355
			$name = array(array('name' => $name, 'content' => $content, 'type' => $type, 'newline' => $newline));
356
		}
357
		elseif (isset($name['name']))
358
		{
359
			// Turn single array into multidimensional
360
			$name = array($name);
361
		}
362
363
		$str = '';
364
		foreach ($name as $meta)
365
		{
366
			$type		= (isset($meta['type']) && $meta['type'] !== 'name')	? 'http-equiv' : 'name';
367
			$name		= isset($meta['name'])					? $meta['name'] : '';
368
			$content	= isset($meta['content'])				? $meta['content'] : '';
369
			$newline	= isset($meta['newline'])				? $meta['newline'] : "\n";
370
371
			$str .= '<meta '.$type.'="'.$name.'" content="'.$content.'" />'.$newline;
372
		}
373
374
		return $str;
375
	}
376
}
377
378
// ------------------------------------------------------------------------
379
380
if ( ! function_exists('br'))
381
{
382
	/**
383
	 * Generates HTML BR tags based on number supplied
384
	 *
385
	 * @deprecated	3.0.0	Use str_repeat() instead
386
	 * @param	int	$count	Number of times to repeat the tag
387
	 * @return	string
388
	 */
389
	function br($count = 1)
390
	{
391
		return str_repeat('<br />', $count);
392
	}
393
}
394
395
// ------------------------------------------------------------------------
396
397
if ( ! function_exists('nbs'))
398
{
399
	/**
400
	 * Generates non-breaking space entities based on number supplied
401
	 *
402
	 * @deprecated	3.0.0	Use str_repeat() instead
403
	 * @param	int
404
	 * @return	string
405
	 */
406
	function nbs($num = 1)
407
	{
408
		return str_repeat('&nbsp;', $num);
409
	}
410
}
411