This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
|||||||||||
2 | /** |
|||||||||||
3 | * XOOPS - PHP Content Management System |
|||||||||||
4 | * Copyright (c) 2001 - 2006 <http://www.xoops.org/> |
|||||||||||
5 | * |
|||||||||||
6 | * Module: xoopsinfo 2.0 |
|||||||||||
7 | * Licence : GPL |
|||||||||||
8 | * Authors : |
|||||||||||
9 | * - Jmorris |
|||||||||||
10 | * - Marco |
|||||||||||
11 | * - Christian |
|||||||||||
12 | * - DuGris (http://www.dugris.info) |
|||||||||||
13 | */ |
|||||||||||
14 | ||||||||||||
15 | include('../../mainfile.php'); |
|||||||||||
16 | global $xoopsDB, $xoopsConfig, $xoopsModule; |
|||||||||||
0 ignored issues
–
show
|
||||||||||||
17 | ||||||||||||
18 | if (file_exists(XOOPS_ROOT_PATH . '/modules/xoopsinfo/language/' . $xoopsConfig['language'] . '/main.php')) { |
|||||||||||
19 | include_once(XOOPS_ROOT_PATH . '/modules/xoopsinfo/language/' . $xoopsConfig['language'] . '/main.php'); |
|||||||||||
20 | } else { |
|||||||||||
21 | include_once(XOOPS_ROOT_PATH . '/modules/xoopsinfo/language/english/main.php'); |
|||||||||||
22 | } |
|||||||||||
23 | ||||||||||||
24 | $ConfigReferer = explode('|', $xoopsModuleConfig['xi_img_referer']); |
|||||||||||
25 | $ref_url = getenv('HTTP_REFERER'); |
|||||||||||
26 | preg_match('|^http://(.*?)/|', $ref_url, $referers); |
|||||||||||
27 | $referer = $referers[1]; |
|||||||||||
28 | ||||||||||||
29 | if (!in_array($referer, $ConfigReferer)) { |
|||||||||||
30 | header('Content-type: image/gif'); |
|||||||||||
31 | $im = imagecreatefromgif(XOOPS_URL . '/modules/xoopsinfo/images/xoopsinfo.gif'); |
|||||||||||
32 | imagegif($im); |
|||||||||||
33 | imagedestroy($im); |
|||||||||||
34 | } else { |
|||||||||||
35 | $result = $GLOBALS['xoopsDB']->query('SELECT VERSION()'); |
|||||||||||
36 | list($mysql_version) = $GLOBALS['xoopsDB']->fetchRow($result); |
|||||||||||
37 | $GLOBALS['xoopsDB']->freeRecordSet($result); |
|||||||||||
38 | ||||||||||||
39 | // Create image |
|||||||||||
40 | header('Content-type: image/png'); |
|||||||||||
41 | $im = @imagecreate(551, 221) or die("Impossible d'initialiser la biblioth�que GD"); |
|||||||||||
0 ignored issues
–
show
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):
The difference between these is the order in which they are executed. In most cases,
you would want to use a boolean operator like 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-FlowOne 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 // 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. ![]() |
||||||||||||
42 | ||||||||||||
43 | // Background Color |
|||||||||||
44 | $imgColorHex = str_replace('#', '', $xoopsModuleConfig['xi_img_background']); |
|||||||||||
45 | $int = hexdec($imgColorHex); |
|||||||||||
46 | $arr = array('red' => 0xFF & ($int >> 0x10), 'green' => 0xFF & ($int >> 0x8), 'blue' => 0xFF & $int); |
|||||||||||
47 | $background_color = imagecolorallocate($im, $arr['red'], $arr['green'], $arr['blue']); |
|||||||||||
48 | ||||||||||||
49 | // Border Color |
|||||||||||
50 | $imgColorHex = str_replace('#', '', $xoopsModuleConfig['xi_img_border']); |
|||||||||||
51 | $int = hexdec($imgColorHex); |
|||||||||||
52 | $arr = array('red' => 0xFF & ($int >> 0x10), 'green' => 0xFF & ($int >> 0x8), 'blue' => 0xFF & $int); |
|||||||||||
53 | $border_color = imagecolorallocate($im, $arr['red'], $arr['green'], $arr['blue']); |
|||||||||||
54 | imagerectangle($im, 0, 0, 550, 220, $border_color); |
|||||||||||
55 | ||||||||||||
56 | // Separate Color |
|||||||||||
57 | $int = hexdec('E18A00'); |
|||||||||||
58 | $arr = array('red' => 0xFF & ($int >> 0x10), 'green' => 0xFF & ($int >> 0x8), 'blue' => 0xFF & $int); |
|||||||||||
59 | $separate_color = imagecolorallocate($im, $arr['red'], $arr['green'], $arr['blue']); |
|||||||||||
60 | imagefilledrectangle($im, 10, 70, 540, 72, $separate_color); |
|||||||||||
61 | imagefilledrectangle($im, 10, 130, 540, 132, $separate_color); |
|||||||||||
62 | imagefilledrectangle($im, 10, 175, 540, 177, $separate_color); |
|||||||||||
63 | ||||||||||||
64 | // ON Color |
|||||||||||
65 | $int = hexdec('009900'); |
|||||||||||
66 | $arr = array('red' => 0xFF & ($int >> 0x10), 'green' => 0xFF & ($int >> 0x8), 'blue' => 0xFF & $int); |
|||||||||||
67 | $color_on = imagecolorallocate($im, $arr['red'], $arr['green'], $arr['blue']); |
|||||||||||
68 | ||||||||||||
69 | // OFF Color |
|||||||||||
70 | $int = hexdec('CC0000'); |
|||||||||||
71 | $arr = array('red' => 0xFF & ($int >> 0x10), 'green' => 0xFF & ($int >> 0x8), 'blue' => 0xFF & $int); |
|||||||||||
72 | $color_off = imagecolorallocate($im, $arr['red'], $arr['green'], $arr['blue']); |
|||||||||||
73 | ||||||||||||
74 | // Constant Color |
|||||||||||
75 | $imgColorHex = str_replace('#', '', $xoopsModuleConfig['xi_img_constant']); |
|||||||||||
76 | $int = hexdec($imgColorHex); |
|||||||||||
77 | $arr = array('red' => 0xFF & ($int >> 0x10), 'green' => 0xFF & ($int >> 0x8), 'blue' => 0xFF & $int); |
|||||||||||
78 | $var_color = imagecolorallocate($im, $arr['red'], $arr['green'], $arr['blue']); |
|||||||||||
79 | ||||||||||||
80 | // Xoops info Color |
|||||||||||
81 | $imgColorHex = str_replace('#', '', $xoopsModuleConfig['xi_img_data']); |
|||||||||||
82 | $int = hexdec($imgColorHex); |
|||||||||||
83 | $arr = array('red' => 0xFF & ($int >> 0x10), 'green' => 0xFF & ($int >> 0x8), 'blue' => 0xFF & $int); |
|||||||||||
84 | $data_color = imagecolorallocate($im, $arr['red'], $arr['green'], $arr['blue']); |
|||||||||||
85 | ||||||||||||
86 | $font = $xoopsModuleConfig['xi_img_font']; |
|||||||||||
87 | $coef = array(1 => 1, 2 => 1, 3 => 1, 4 => 1.15, 5 => 1.3); |
|||||||||||
88 | $col1 = 185 * $coef[$font]; |
|||||||||||
89 | $col2 = 210 * $coef[$font]; |
|||||||||||
90 | $col3 = 235 * $coef[$font]; |
|||||||||||
91 | // XOOPS_URL |
|||||||||||
92 | imagestring($im, $font, 10, 5, _XI_WEBSITE, $var_color); |
|||||||||||
93 | imagestring($im, $font, $col1, 5, ' : ', $var_color); |
|||||||||||
94 | imagestring($im, $font, $col2, 5, XOOPS_URL, $data_color); |
|||||||||||
95 | ||||||||||||
96 | // XOOPS_VERSION |
|||||||||||
97 | imagestring($im, $font, 10, 20, _XI_XOOPS_VERSION, $var_color); |
|||||||||||
98 | imagestring($im, $font, $col1, 20, ' : ', $var_color); |
|||||||||||
99 | imagestring($im, $font, $col2, 20, XOOPS_VERSION, $data_color); |
|||||||||||
100 | ||||||||||||
101 | // Theme |
|||||||||||
102 | imagestring($im, $font, 10, 35, _XI_XOOPS_THEME, $var_color); |
|||||||||||
103 | imagestring($im, $font, $col1, 35, ' : ', $var_color); |
|||||||||||
104 | imagestring($im, $font, $col2, 35, $xoopsConfig['theme_set'], $data_color); |
|||||||||||
105 | ||||||||||||
106 | // template |
|||||||||||
107 | imagestring($im, $font, 10, 50, _XI_XOOPS_TEMPLATE, $var_color); |
|||||||||||
108 | imagestring($im, $font, $col1, 50, ' : ', $var_color); |
|||||||||||
109 | imagestring($im, $font, $col2, 50, $xoopsConfig['template_set'], $data_color); |
|||||||||||
110 | ||||||||||||
111 | // Server Version |
|||||||||||
112 | imagestring($im, $font, 10, 80, _XI_SOFTWARE_SERVEUR, $var_color); |
|||||||||||
113 | imagestring($im, $font, $col1, 80, ' : ', $var_color); |
|||||||||||
114 | imagestring($im, $font, $col2, 80, $_SERVER['SERVER_SOFTWARE'], $data_color); |
|||||||||||
115 | ||||||||||||
116 | // PHP Version |
|||||||||||
117 | imagestring($im, $font, 10, 95, _XI_PHP_VERSION, $var_color); |
|||||||||||
118 | imagestring($im, $font, $col1, 95, ' : ', $var_color); |
|||||||||||
119 | imagestring($im, $font, $col2, 95, phpversion(), $data_color); |
|||||||||||
120 | ||||||||||||
121 | // Mysql Version |
|||||||||||
122 | imagestring($im, $font, 10, 110, _XI_MSQUL_VERSION, $var_color); |
|||||||||||
123 | imagestring($im, $font, $col1, 110, ' : ', $var_color); |
|||||||||||
124 | imagestring($im, $font, $col2, 110, $mysql_version, $data_color); |
|||||||||||
125 | ||||||||||||
126 | // Support librairie GD |
|||||||||||
127 | imagestring($im, $font, 10, 140, _XI_PHP_GD_LIB, $var_color); |
|||||||||||
128 | imagestring($im, $font, $col1, 140, ' : ', $var_color); |
|||||||||||
129 | if (function_exists('gd_info')) { |
|||||||||||
130 | imagestring($im, $font, $col2, 140, _XI_PHP_GD_LIB_ON, $color_on); |
|||||||||||
131 | imagestring($im, $font, $col3, 140, _XI_PHP_GD_LIB_GDON, $data_color); |
|||||||||||
132 | } else { |
|||||||||||
133 | imagestring($im, $font, $col2, 140, _XI_PHP_GD_LIB_OFF, $color_off); |
|||||||||||
134 | imagestring($im, $font, $col3, 140, _XI_PHP_GD_LIB_GDOFF, $data_color); |
|||||||||||
135 | } |
|||||||||||
136 | ||||||||||||
137 | imagestring($im, $font, 10, 155, _XI_PHP_GD_VERSION, $var_color); |
|||||||||||
138 | imagestring($im, $font, $col1, 155, ' : ', $var_color); |
|||||||||||
139 | if (function_exists('gd_info')) { |
|||||||||||
140 | if (true == $gdlib = gd_info()) { |
|||||||||||
141 | imagestring($im, $font, $col2, 155, $gdlib['GD Version'], $data_color); |
|||||||||||
142 | } |
|||||||||||
143 | } |
|||||||||||
144 | ||||||||||||
145 | // downloads status |
|||||||||||
146 | imagestring($im, $font, 10, 185, _XI_PHP_UPLOAD_STATUS, $var_color); |
|||||||||||
147 | imagestring($im, $font, $col1, 185, ' : ', $var_color); |
|||||||||||
148 | if (ini_get('file_uploads')) { |
|||||||||||
149 | imagestring($im, $font, $col2, 185, _XI_PHP_GD_LIB_ON, $color_on); |
|||||||||||
150 | } else { |
|||||||||||
151 | imagestring($im, $font, $col2, 185, _XI_PHP_GD_LIB_OFF, $color_off); |
|||||||||||
152 | } |
|||||||||||
153 | ||||||||||||
154 | // downloads status |
|||||||||||
155 | imagestring($im, $font, 10, 200, _XI_PHP_UPLOAD_MAXSIZE, $var_color); |
|||||||||||
156 | imagestring($im, $font, $col1, 200, ' : ', $var_color); |
|||||||||||
157 | imagestring($im, $font, $col2, 200, ini_get('upload_max_filesize'), $data_color); |
|||||||||||
158 | ||||||||||||
159 | imagepng($im); |
|||||||||||
160 | imagedestroy($im); |
|||||||||||
161 | } |
|||||||||||
162 |
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state