Issues (19)

Security Analysis    no request data  

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.

code/FooterTextSiteConfig.php (17 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
class FooterTextSiteConfig extends DataExtension {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
3
	static $db = array(
0 ignored issues
show
The visibility should be declared for property $db.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

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

Loading history...
4
		'FooterText' => 'HTMLText',
5
		'ColumnStart' => "Enum('1,2,3,4')",
6
		'ColumnWidth' => "Enum('1,2,3,4')"
7
	);
8
9
	function updateCMSFields(FieldList $fields){
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Comprehensibility Best Practice introduced by
It is recommend to declare an explicit visibility for updateCMSFields.

Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed.

If you are not sure which visibility to choose, it is a good idea to start with the most restrictive visibility, and then raise visibility as needed, i.e. start with private, and only raise it to protected if a sub-class needs to have access, or public if an external class needs access.

Loading history...
10
		$footerTabName = 'Root.'._t('SiteConfig.FOOTER', 'Footer');
11
		$fields->addFieldToTab($footerTabName, $h1=new HTMLEditorField('FooterText', _t('SiteConfig.FOOTER_TEXT', "Text to display in the footer")));	
0 ignored issues
show
Expected 1 space before = sign of default value
Loading history...
Expected 1 space after = sign of default value
Loading history...
Spaces must be used for alignment; tabs are not allowed
Loading history...
12
		$options1 = singleton('SiteConfig')->dbObject('ColumnStart')->EnumValues();
0 ignored issues
show
Spaces must be used for alignment; tabs are not allowed
Loading history...
13
		$options2 = singleton('SiteConfig')->dbObject('ColumnWidth')->EnumValues();
0 ignored issues
show
Spaces must be used for alignment; tabs are not allowed
Loading history...
14
		$columnStartField = new DropdownField('ColumnStart',_t('SiteConfig.FOOTER_TEXT_START_COLUMN','Which column (of four) should the footer text start in',$options1));
0 ignored issues
show
$columnStartField is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
Spaces must be used for alignment; tabs are not allowed
Loading history...
15
		$columnWidthField = new DropdownField('ColumnStart',_t('SiteConfig.FOOTER_TEXT_WIDTH_COLUMN','How many, of four columns, should the footer text take up',$options2));
0 ignored issues
show
$columnWidthField is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
Spaces must be used for alignment; tabs are not allowed
Loading history...
16
		//$fields->addFieldToTab("Root.Footer", $columnStartField);	
0 ignored issues
show
Spaces must be used for alignment; tabs are not allowed
Loading history...
17
		//$fields->addFieldToTab("Root.Footer", $h1=new HTMLEditorField('FooterText', _t('SiteConfig.FOOTER_TEXT', "Text to display in the footer")));	
0 ignored issues
show
Spaces must be used for alignment; tabs are not allowed
Loading history...
18
		$h1->setRows(6);
0 ignored issues
show
Spaces must be used for alignment; tabs are not allowed
Loading history...
19
	}
0 ignored issues
show
Spaces must be used for alignment; tabs are not allowed
Loading history...
20
}