Issues (1752)

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.

class/ubb.php (5 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
 * Obsoleted.
4
 *
5
* @package      MaGod
6
* @copyright    Copyright 2004, Fwolf
7
* @author       Fwolf <[email protected]>
8
*/
9
10
require_once('MaGod/MaGod.php');
11
12
/**
13
* Ubb类
14
* 完成对UBB代码的转换
15
*
16
* @package    MaGod
17
* @copyright  Copyright 2004, Fwolf
18
* @author     Fwolf <[email protected]>
19
* @since      2004-02-18 22:10:55
20
* @access     public
21
* @version    $Id$
22
*/
23
24
class Ubb
25
{
26
27
	/**
28
	 * 从UBB的URL格式中取得链接地址
29
	 *
30
	 * @param	string	$url
31
	 * @access	public
32
	 * @return string
33
	 */
34
	function Url2Link($url)
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...
35
	{
36
		$str = '';
0 ignored issues
show
$str 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...
37
		//格式一:[url=地址]名称[/url]
38
		$patterns = '/\[url=(\S+)\](\S+)\[\/url\]/i';
39
		$replace = '\\1';
40
		$str = preg_replace( $patterns, $replace, $url );
41
		if ( empty($str) )
42
		{
43
			//格式二:[url]地址[/url]
44
		    $patterns = '/\[url\](\S+)\[\/url\]/i';
45
			$replace = '\\1';
46
			$str = preg_replace( $patterns, $replace, $url );
47
		}
48
		return($str);
49
	} // end of function Url2Link
50
51
52
	/**
53
	 * 从UBB的URL格式中取得链接名称
54
	 *
55
	 * @param	string	$url
56
	 * @access	public
57
	 * @return string
58
	 */
59
	function Url2Name($url)
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...
60
	{
61
		$str = '';
0 ignored issues
show
$str 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...
62
		//格式一:[url=地址]名称[/url]
63
		$patterns = '/\[url=(\S+)\](\S+)\[\/url\]/i';
64
		$replace = '\\2';
65
		$str = preg_replace( $patterns, $replace, $url );
66
		return($str);
67
	} // end of function Url2Name
68
69
} // end of class Ubb
70
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
71