Issues (85)

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/Table/Render/SimpleTable.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
 * @package    Fuel\Common
4
 * @version    2.0
5
 * @author     Fuel Development Team
6
 * @license    MIT License
7
 * @copyright  2010 - 2015 Fuel Development Team
8
 * @link       http://fuelphp.com
9
 */
10
11
namespace Fuel\Common\Table\Render;
12
13
use Fuel\Common\Table\Render;
14
use Fuel\Common\Table\Cell;
15
use Fuel\Common\Table\Row;
16
use Fuel\Common\Table;
17
use Fuel\Common\Html;
18
19
/**
20
 * Uses a table structure built with Table to create a HTML table tag and
21
 * content.
22
 *
23
 * @package Fuel\Common
24
 *
25
 * @since 2.0
26
 */
27
class SimpleTable extends Render
28
{
29
	/**
30
	 * Generates a "correct" table tag to contain the rendered rows
31
	 *
32
	 * @param Table $table
33
	 * @param array $rows
34
	 * @param array $headers
35
	 * @param array $footers
36
	 *
37
	 * @return string
38
	 */
39
	protected function container(Table $table, array $rows, array $headers, array $footers)
40
	{
41
		$html = '<table';
42
		$this->addAttributes($html, $table->getAttributes());
43
		$html .= '><thead>';
44
		$html .= implode("\n", $headers);
45
		$html .= '</thead><tbody>';
46
		$html .= implode("\n", $rows);
47
		$html .= '</tbody><tfoot>';
48
		$html .= implode("\n", $footers);
49
		$html .= '</tfoot></table>';
50
51
		return $html;
52
	}
53
54
	/**
55
	 * Generates a tr with the given rendered cells
56
	 *
57
	 * @param Row   $row
58
	 * @param array $cells
59
	 *
60
	 * @return string
61
	 */
62
	protected function row(Row $row, array $cells)
63
	{
64
		$html = '<tr';
65
		$this->addAttributes($html, $row->getAttributes());
66
		$html .= '>' . implode('', $cells) . '</tr>';
67
68
		return $html;
69
	}
70
71
	/**
72
	 * Creates a td tag using the given Cell
73
	 *
74
	 * @param Cell $cell
75
	 *
76
	 * @return string
77
	 */
78 View Code Duplication
	protected function cell(Cell $cell)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
79
	{
80
		$html = '<td';
81
		$this->addAttributes($html, $cell->getAttributes());
82
		$html .= '>' . $cell->getContent() . '</td>';
83
84
		return $html;
85
	}
86
87
	/**
88
	 * Helper function to convert an array into a list of attributes and append
89
	 * them to a string
90
	 *
91
	 * @param string $html
92
	 * @param array  $attributes
93
	 */
94
	protected function addAttributes(&$html, array $attributes)
95
	{
96
		if ( count($attributes) > 0 )
97
		{
98
			$attributes = Html::arrayToAttributes($attributes);
99
100
			$html .= ' ' . $attributes;
101
		}
102
	}
103
104
	protected function footerCell(Table\Cell $cell)
105
	{
106
		return $this->cell($cell);
107
	}
108
109
	protected function footerRow(Table\Row $row, array $cells)
110
	{
111
		return $this->row($row, $cells);
112
	}
113
114 View Code Duplication
	protected function headerCell(Table\Cell $cell)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
115
	{
116
		$html = '<th';
117
		$this->addAttributes($html, $cell->getAttributes());
118
		$html .= '>' . $cell->getContent() . '</th>';
119
120
		return $html;
121
	}
122
123
	protected function headerRow(Table\Row $row, array $cells)
124
	{
125
		return $this->row($row, $cells);
126
	}
127
128
}
129