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/sms.test.php (8 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
 * Test - class Sms
4
 *
5
 * @package     fwolflib
6
 * @subpackage	class.test
7
 * @copyright   Copyright 2010, Fwolf
8
 * @author      Fwolf <[email protected]>
9
 * @since		2010-11-23
10
 */
11
12
13
// Define like this, so test can run both under eclipse and web alone.
14
// {{{
15
if (! defined('SIMPLE_TEST')) {
16
	define('SIMPLE_TEST', 'simpletest/');
17
	require_once(SIMPLE_TEST . 'autorun.php');
18
}
19
// Then set output encoding
20
//header('Content-Type: text/html; charset=utf-8');
21
// }}}
22
23
// Require library define file which need test
24
require_once('../fwolflib.php');
25
require_once(FWOLFLIB . 'class/adodb.php');
26
require_once(FWOLFLIB . 'class/sms.php');
27
require_once(FWOLFLIB . 'func/request.php');
28
29
30
class TestClassSms extends UnitTestCase {
31
32
	function __construct() {
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...
33
		$ar_db = array(
34
			'type'	=> 'mysqli',
35
			'host'	=> 'localhost',
36
			'user'	=> 't-sms',
37
			'pass'	=> '',
38
			'name'	=> 't-sms',
39
			'lang'	=> 'utf-8',
40
		);
41
		$o_db = new Adodb($ar_db);
0 ignored issues
show
Deprecated Code introduced by
The class Adodb has been deprecated with message: Use Fwlib\Bridge\Adodb

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
42
		$o_db->Connect();
43
		$this->oSms = new Sms($o_db);
0 ignored issues
show
Deprecated Code introduced by
The class Sms has been deprecated with message: Use Fwlib\Net\Sms\SmsSender

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
44
		// Cat of debug sms
45
		$this->iCat = 1020000;
46
	} // end of func __construct
47
48
49
	function TestCountPart () {
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...
50
		$s_sms = '';	// 0
51
		$this->assertEqual(0, $this->oSms->CountPart($s_sms));
52
		$s_sms = '01234567890123456789012345678901234567890123456789'
53
			. '01234567890123456789012345678901234567890123456789'
54
			. '0123456789012345678901234567890123456789';	// 140
55
		$this->assertEqual(1, $this->oSms->CountPart($s_sms));
56
		$s_sms = '01234567890123456789012345678901234567890123456789'
57
			. '01234567890123456789012345678901234567890123456789
58
01234567890123456789012345678901234567890';	// 141
59
		$this->assertEqual(2, $this->oSms->CountPart($s_sms));
60
61
		$s_sms = '一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十'
62
			. '一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
63
一二三四五六七八';	// 69
64
		$this->assertEqual(1, $this->oSms->CountPart($s_sms));
65
		$s_sms = '0123456789一二三四五六七八九十一二三四五六七八九十'
66
			. '一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十'
67
			. '一二三四五六七八九十';	// 70
68
		$this->assertEqual(1, $this->oSms->CountPart($s_sms));
69
		$s_sms = '0123456789一二三四五六七八九十一二三四五六七八九十'
70
			. '一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十'
71
			. '一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十'
72
			. '一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十'
73
			. '一二三四五六七八九十一二三四五六七八九十';	// 140
74
		$this->assertEqual(2, $this->oSms->CountPart($s_sms));
75
	} // end of func TestCountPart
76
77
78
    function TestDestParse () {
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...
79
		$s_dest = "13912345678
80
			13912345678,;
81
			008613912345678 ,\t
82
			13921345678\r\n\t
83
			1392345678\r\n\t
84
			+8613912345678;
85
			+8613912345678,end
86
		";
87
		$ar_dest = array('13912345678', '13921345678');
88
		$this->assertEqual($ar_dest, $this->oSms->DestParse($s_dest));
89
90
		$s_dest = "13012345678,13012345679";
91
		$ar_dest = array('13012345678', '13012345679');
92
		$this->assertEqual($ar_dest, $this->oSms->DestParse($s_dest));
93
    } // end of func TestDestParse
94
95
    function TestSendUsingGammuSmsdInject () {
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...
96
		$this->oSms->SendUsingGammuSmsdInject('1391234567'
97
			, '测试短信', $this->iCat);
98
    } // end of func TestSendUsingGammuSmsdInject
99
100
} // end of class TestClassSms
101
102
103
// Change output charset in this way.
104
// {{{
105
$s_url = GetSelfUrl(false);
0 ignored issues
show
Deprecated Code introduced by
The function GetSelfUrl() has been deprecated with message: Use Fwlib\Util\HttpUtil::getSelfUrl()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
106
$s_url = substr($s_url, strrpos($s_url, '/') + 1);
107
if ('sms.test.php' == $s_url) {
108
	$test = new TestClassSms();
109
	$test->run(new HtmlReporter('utf-8'));
110
}
111
// }}}
112
?>
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...
113