Issues (4141)

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.

PHPExcel/Shared/PDF/config/tcpdf_config.php (4 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
// File name   : tcpdf_config.php
4
// Begin       : 2004-06-11
5
// Last Update : 2010-08-19
6
//
7
// Description : Configuration file for TCPDF.
8
//
9
// Author: Nicola Asuni
10
//
11
// (c) Copyright:
12
//               Nicola Asuni
13
//               Tecnick.com s.r.l.
14
//               Via Della Pace, 11
15
//               09044 Quartucciu (CA)
16
//               ITALY
17
//               www.tecnick.com
18
//               [email protected]
19
//============================================================+
20
21
/**
22
 * Configuration file for TCPDF.
23
 * @author Nicola Asuni
24
 * @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - [email protected]
25
 * @package com.tecnick.tcpdf
26
 * @version 4.9.005
27
 * @link http://tcpdf.sourceforge.net
28
 * @license http://www.gnu.org/copyleft/lesser.html LGPL
29
 * @since 2004-10-27
30
 */
31
32
// If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.
33
34
if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
35
36
	// DOCUMENT_ROOT fix for IIS Webserver
37
	if ((!isset(DIR_RAIZ)) OR (empty(DIR_RAIZ))) {
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ')', expecting '['
Loading history...
Comprehensibility Best Practice introduced by
Using logical operators such as or instead of || is generally not recommended.

PHP has two types of connecting operators (logical operators, and boolean operators):

  Logical Operators Boolean Operator
AND - meaning and &&
OR - meaning or ||

The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like &&, or ||.

Let’s take a look at a few examples:

// Logical operators have lower precedence:
$f = false or true;

// is executed like this:
($f = false) or true;


// Boolean operators have higher precedence:
$f = false || true;

// is executed like this:
$f = (false || true);

Logical Operators are used for Control-Flow

One case where you explicitly want to use logical operators is for control-flow such as this:

$x === 5
    or die('$x must be 5.');

// Instead of
if ($x !== 5) {
    die('$x must be 5.');
}

Since die introduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined with throw at this point:

// The following is currently a parse error.
$x === 5
    or throw new RuntimeException('$x must be 5.');

These limitations lead to logical operators rarely being of use in current PHP code.

Loading history...
38
		if(isset($_SERVER['SCRIPT_FILENAME'])) {
39
			DIR_RAIZ = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
40
		} elseif(isset($_SERVER['PATH_TRANSLATED'])) {
41
			DIR_RAIZ = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
42
		}	else {
43
			// define here your DOCUMENT_ROOT path if the previous fails
44
			DIR_RAIZ = '/var/www';
45
		}
46
	}
47
48
	// Automatic calculation for the following K_PATH_MAIN constant
49
	$k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config'))));
50
	if (substr($k_path_main, -1) != '/') {
51
		$k_path_main .= '/';
52
	}
53
54
	/**
55
	 * Installation path (/var/www/tcpdf/).
56
	 * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
57
	 */
58
	define ('K_PATH_MAIN', $k_path_main);
59
60
	// Automatic calculation for the following K_PATH_URL constant
61
	$k_path_url = $k_path_main; // default value for console mode
62
	if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
0 ignored issues
show
Comprehensibility Best Practice introduced by
Using logical operators such as and instead of && is generally not recommended.

PHP has two types of connecting operators (logical operators, and boolean operators):

  Logical Operators Boolean Operator
AND - meaning and &&
OR - meaning or ||

The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like &&, or ||.

Let’s take a look at a few examples:

// Logical operators have lower precedence:
$f = false or true;

// is executed like this:
($f = false) or true;


// Boolean operators have higher precedence:
$f = false || true;

// is executed like this:
$f = (false || true);

Logical Operators are used for Control-Flow

One case where you explicitly want to use logical operators is for control-flow such as this:

$x === 5
    or die('$x must be 5.');

// Instead of
if ($x !== 5) {
    die('$x must be 5.');
}

Since die introduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined with throw at this point:

// The following is currently a parse error.
$x === 5
    or throw new RuntimeException('$x must be 5.');

These limitations lead to logical operators rarely being of use in current PHP code.

Loading history...
63
		if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
0 ignored issues
show
Comprehensibility Best Practice introduced by
Using logical operators such as and instead of && is generally not recommended.

PHP has two types of connecting operators (logical operators, and boolean operators):

  Logical Operators Boolean Operator
AND - meaning and &&
OR - meaning or ||

The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like &&, or ||.

Let’s take a look at a few examples:

// Logical operators have lower precedence:
$f = false or true;

// is executed like this:
($f = false) or true;


// Boolean operators have higher precedence:
$f = false || true;

// is executed like this:
$f = (false || true);

Logical Operators are used for Control-Flow

One case where you explicitly want to use logical operators is for control-flow such as this:

$x === 5
    or die('$x must be 5.');

// Instead of
if ($x !== 5) {
    die('$x must be 5.');
}

Since die introduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined with throw at this point:

// The following is currently a parse error.
$x === 5
    or throw new RuntimeException('$x must be 5.');

These limitations lead to logical operators rarely being of use in current PHP code.

Loading history...
64
			$k_path_url = 'https://';
65
		} else {
66
			$k_path_url = 'http://';
67
		}
68
		$k_path_url .= $_SERVER['HTTP_HOST'];
69
		$k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen(DIR_RAIZ) - 1)));
70
	}
71
72
	/**
73
	 * URL path to tcpdf installation folder (http://localhost/tcpdf/).
74
	 * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
75
	 */
76
	define ('K_PATH_URL', $k_path_url);
77
78
	/**
79
	 * path for PDF fonts
80
	 * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
81
	 */
82
	define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
83
84
	/**
85
	 * cache directory for temporary files (full path)
86
	 */
87
	define ('K_PATH_CACHE', K_PATH_MAIN.'cache/');
88
89
	/**
90
	 * cache directory for temporary files (url path)
91
	 */
92
	define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/');
93
94
	/**
95
	 *images directory
96
	 */
97
	define ('K_PATH_IMAGES', K_PATH_MAIN.'images/');
98
99
	/**
100
	 * blank image
101
	 */
102
	define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');
103
104
	/**
105
	 * page format
106
	 */
107
	define ('PDF_PAGE_FORMAT', 'A4');
108
109
	/**
110
	 * page orientation (P=portrait, L=landscape)
111
	 */
112
	define ('PDF_PAGE_ORIENTATION', 'P');
113
114
	/**
115
	 * document creator
116
	 */
117
	define ('PDF_CREATOR', 'TCPDF');
118
119
	/**
120
	 * document author
121
	 */
122
	define ('PDF_AUTHOR', 'TCPDF');
123
124
	/**
125
	 * header title
126
	 */
127
	define ('PDF_HEADER_TITLE', 'TCPDF Example');
128
129
	/**
130
	 * header description string
131
	 */
132
	define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
133
134
	/**
135
	 * image logo
136
	 */
137
	define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
138
139
	/**
140
	 * header logo image width [mm]
141
	 */
142
	define ('PDF_HEADER_LOGO_WIDTH', 30);
143
144
	/**
145
	 *  document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
146
	 */
147
	define ('PDF_UNIT', 'mm');
148
149
	/**
150
	 * header margin
151
	 */
152
	define ('PDF_MARGIN_HEADER', 5);
153
154
	/**
155
	 * footer margin
156
	 */
157
	define ('PDF_MARGIN_FOOTER', 10);
158
159
	/**
160
	 * top margin
161
	 */
162
	define ('PDF_MARGIN_TOP', 27);
163
164
	/**
165
	 * bottom margin
166
	 */
167
	define ('PDF_MARGIN_BOTTOM', 25);
168
169
	/**
170
	 * left margin
171
	 */
172
	define ('PDF_MARGIN_LEFT', 15);
173
174
	/**
175
	 * right margin
176
	 */
177
	define ('PDF_MARGIN_RIGHT', 15);
178
179
	/**
180
	 * default main font name
181
	 */
182
	define ('PDF_FONT_NAME_MAIN', 'helvetica');
183
184
	/**
185
	 * default main font size
186
	 */
187
	define ('PDF_FONT_SIZE_MAIN', 10);
188
189
	/**
190
	 * default data font name
191
	 */
192
	define ('PDF_FONT_NAME_DATA', 'helvetica');
193
194
	/**
195
	 * default data font size
196
	 */
197
	define ('PDF_FONT_SIZE_DATA', 8);
198
199
	/**
200
	 * default monospaced font name
201
	 */
202
	define ('PDF_FONT_MONOSPACED', 'courier');
203
204
	/**
205
	 * ratio used to adjust the conversion of pixels to user units
206
	 */
207
	define ('PDF_IMAGE_SCALE_RATIO', 1.25);
208
209
	/**
210
	 * magnification factor for titles
211
	 */
212
	define('HEAD_MAGNIFICATION', 1.1);
213
214
	/**
215
	 * height of cell repect font height
216
	 */
217
	define('K_CELL_HEIGHT_RATIO', 1.25);
218
219
	/**
220
	 * title magnification respect main font size
221
	 */
222
	define('K_TITLE_MAGNIFICATION', 1.3);
223
224
	/**
225
	 * reduction factor for small font
226
	 */
227
	define('K_SMALL_RATIO', 2/3);
228
229
	/**
230
	 * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
231
	 */
232
	define('K_THAI_TOPCHARS', true);
233
234
	/**
235
	 * if true allows to call TCPDF methods using HTML syntax
236
	 * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
237
	 */
238
	define('K_TCPDF_CALLS_IN_HTML', true);
239
}
240
241
//============================================================+
242
// END OF FILE
243
//============================================================+
244