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.

func/datetime.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
 * Provide date or time relate function
4
 *
5
 * @package     fwolflib
6
 * @subpackage	func.datetime
7
 * @copyright   Copyright 2009-2012, Fwolf
8
 * @author      Fwolf <[email protected]>
9
 * @since		2009-02-24
10
 */
11
12
13
require_once(dirname(__FILE__) . '/../fwolflib.php');
14
15
16
/**
17
 * Convert sec back to str describe
18
 *
19
 * No week in result.
20
 *
21
 * @deprecated      Use Fwlib\Util\DatetimeUtil::cvtSecToStr()
22
 * @param	int		$i_sec
23
 * @param	boolean	$b_simple				If true, use ymdhis instead of word
24
 * @return	string
25
 */
26
function SecToStr ($i_sec, $b_simple = true) {
27
	if (empty($i_sec) || !is_numeric($i_sec))
28
		return '';
29
30
	$ar_dict = array(
31
		array('c', -1,	'century',	'centuries'),
32
		array('y', 100,	'year',		'years'),
33
		// 12m != 1y, can't count month in.
34
//		array('m', 12,	'month',	'months'),
35
		array('d', 365,	'day',		'days'),
36
		array('h', 24,	'hour',		'hours'),
37
		array('i', 60,	'minute',	'minutes'),
38
		array('s', 60,	'second',	'seconds'),
39
	);
40
	$i = count($ar_dict);
41
	// Loop from end of $ar_dict
42
	$s = '';
43
	while (0 < $i && 0 < $i_sec) {
44
		// 1. for loop, 2. got current array index
45
		$i --;
46
47
		// Reach top level, end loop
48
		if (-1 == $ar_dict[$i][1]) {
49
			$s = $i_sec . $ar_dict[$i][(($b_simple) ? 0
50
				: ((1 == $i_sec) ? 2 : 3))]
51
				. ' ' . $s;
52
			break;
53
		}
54
55
		$j = $i_sec % $ar_dict[$i][1];
56
		if (0 != $j)
57
			$s = $j . $ar_dict[$i][(($b_simple) ? 0
58
				: ((1 == $i_sec) ? 2 : 3))]
59
				. ' ' . $s;
60
		$i_sec = floor($i_sec / $ar_dict[$i][1]);
61
	}
62
63
	return rtrim($s);
64
} // end of func SecToStr
65
66
67
/**
68
 * Convert str to seconds it means
69
 *
70
 * Like 1m, 20d or combined
71
 *
72
 * Solid: 1m = 30d, 1y = 365d
73
 *
74
 * @deprecated      Use Fwlib\Util\DatetimeUtil::cvtStrToSec()
75
 * @param	string	$str
76
 * @return	integer
77
 */
78
function StrToSec ($str) {
79
	if (empty($str))
80
		return 0;
81
82
	// All number, return directly
83
	if (is_numeric($str))
84
		return $str;
85
86
	// Parse c, y, m, w, d, h, i, s
87
	$str = strtolower($str);
88
	$str = strtr($str, array(
89
		'sec'		=> 's',
90
		'second'	=> 's',
91
		'seconds'	=> 's',
92
		'min'		=> 'i',
93
		'minute'	=> 'i',
94
		'minutes'	=> 'i',
95
		'hour'		=> 'h',
96
		'hours'		=> 'h',
97
		'day'		=> 'd',
98
		'days'		=> 'd',
99
		'week'		=> 'w',
100
		'weeks'		=> 'w',
101
		'month'		=> 'm',
102
		'months'	=> 'm',
103
		'year'		=> 'y',
104
		'years'		=> 'y',
105
		'century'	=> 'c',
106
		'centuries'	=> 'c',
107
	));
108
	$str = preg_replace(array(
109
		'/([+-]?\d+)s/',
110
		'/([+-]?\d+)i/',
111
		'/([+-]?\d+)h/',
112
		'/([+-]?\d+)d/',
113
		'/([+-]?\d+)w/',
114
		'/([+-]?\d+)m/',
115
		'/([+-]?\d+)y/',
116
		'/([+-]?\d+)c/',
117
	), array(
118
		'+$1 ',
119
		'+$1 * 60 ',
120
		'+$1 * 3600 ',
121
		'+$1 * 86400 ',
122
		'+$1 * 604800 ',
123
		'+$1 * 2592000 ',
124
		'+$1 * 31536000 ',
125
		'+$1 * 3153600000 ',
126
	), $str);
127
	// Fix +-
128
	$str = preg_replace('/\+\s*\-/', '-', $str);
129
	$str = preg_replace('/\-\s*\+/', '-', $str);
130
	$str = preg_replace('/\+\s*\+/', '+', $str);
131
	eval('$i_sec = ' . $str . ';');
132
	return $i_sec;
0 ignored issues
show
The variable $i_sec does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
133
} // end of func StrToSec
134
135
136
/**
137
 * strtotime added remove of ':000' in sybase time(probably because dblib)
138
 *
139
 * @deprecated      Use Fwlib\Util\DatetimeUtil::cvtTimeFromSybase()
140
 * @param	string	$time
141
 * @return	integer
142
 */
143
function Strtotime1 ($time) {
144
	if (!empty($time)) {
145
		$time = preg_replace('/:\d{3}/', '', $time);
146
	}
147
	return strtotime($time);
148
} // end of func Strtotime1
149
150
151
?>
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...
152