|
19 | 19 | $appVersion = '7.14.1-mod'; |
20 | 20 |
|
21 | 21 | // PostgreSQL and PHP minimum version |
| 22 | + global $postgresqlMinVer; |
22 | 23 | $postgresqlMinVer = '7.4'; |
23 | 24 | $phpMinVer = '7.2'; |
24 | 25 |
|
|
50 | 51 | require_once('./classes/Misc.php'); |
51 | 52 | $misc = new Misc(); |
52 | 53 |
|
53 | | - // Session start: if extra_session_security is on, make sure cookie_samesite |
54 | | - // is on (exit if we fail); otherwise, just start the session |
55 | | - $our_session_name = 'PPA_ID'; |
56 | | - if ($conf['extra_session_security']) { |
57 | | - if (version_compare(phpversion(), '7.3', '<')) { |
58 | | - exit('PHPPgAdmin cannot be fully secured while running under PHP versions before 7.3. Please upgrade PHP if possible. If you cannot upgrade, and you\'re willing to assume the risk of CSRF attacks, you can change the value of "extra_session_security" to false in your config.inc.php file.'); |
59 | | - } |
60 | | - if (ini_get('session.auto_start')) { |
61 | | - // If session.auto_start is on, and the session doesn't have |
62 | | - // session.cookie_samesite set, destroy and re-create the session |
63 | | - if (session_name() !== $our_session_name) { |
64 | | - $setting = strtolower(ini_get('session.cookie_samesite')); |
65 | | - if ($setting !== 'lax' && $setting !== 'strict') { |
66 | | - session_destroy(); |
67 | | - session_name($our_session_name); |
68 | | - ini_set('session.cookie_samesite', 'Strict'); |
69 | | - session_start(); |
70 | | - } |
71 | | - } |
72 | | - } else { |
73 | | - session_name($our_session_name); |
74 | | - ini_set('session.cookie_samesite', 'Strict'); |
75 | | - session_start(); |
76 | | - } |
77 | | - } else { |
78 | | - if (!ini_get('session.auto_start')) { |
79 | | - session_name($our_session_name); |
80 | | - session_start(); |
81 | | - } |
82 | | - } |
83 | | - |
84 | | - // Do basic PHP configuration checks |
85 | | - if (ini_get('magic_quotes_gpc')) { |
86 | | - $misc->stripVar($_GET); |
87 | | - $misc->stripVar($_POST); |
88 | | - $misc->stripVar($_COOKIE); |
89 | | - $misc->stripVar($_REQUEST); |
| 54 | + // Session start: if extra_session_security is on, make sure cookie_samesite |
| 55 | + // is on (exit if we fail); otherwise, just start the session |
| 56 | + $our_session_name = 'PPA_ID'; |
| 57 | + if ($conf['extra_session_security']) { |
| 58 | + if (version_compare(phpversion(), '7.3', '<')) { |
| 59 | + exit('PHPPgAdmin cannot be fully secured while running under PHP versions before 7.3. Please upgrade PHP if possible. If you cannot upgrade, and you\'re willing to assume the risk of CSRF attacks, you can change the value of "extra_session_security" to false in your config.inc.php file.'); |
| 60 | + } |
| 61 | + |
| 62 | + if (ini_get('session.auto_start')) { |
| 63 | + // If session.auto_start is on, and the session doesn't have |
| 64 | + // session.cookie_samesite set, destroy and re-create the session |
| 65 | + if (session_name() !== $our_session_name) { |
| 66 | + $setting = strtolower(ini_get('session.cookie_samesite')); |
| 67 | + |
| 68 | + if ($setting !== 'lax' && $setting !== 'strict') { |
| 69 | + session_destroy(); |
| 70 | + session_name($our_session_name); |
| 71 | + ini_set('session.cookie_samesite', 'Strict'); |
| 72 | + session_start(); |
| 73 | + } |
| 74 | + } |
| 75 | + } else { |
| 76 | + session_name($our_session_name); |
| 77 | + ini_set('session.cookie_samesite', 'Strict'); |
| 78 | + session_start(); |
| 79 | + } |
| 80 | + } else { |
| 81 | + if (!ini_get('session.auto_start')) { |
| 82 | + session_name($our_session_name); |
| 83 | + session_start(); |
| 84 | + } |
90 | 85 | } |
91 | 86 |
|
92 | | - // This has to be deferred until after stripVar above |
93 | 87 | $misc->setHREF(); |
94 | 88 | $misc->setForm(); |
95 | 89 |
|
96 | 90 | // Enforce PHP environment |
97 | | - ini_set('magic_quotes_runtime', 0); |
98 | | - ini_set('magic_quotes_sybase', 0); |
99 | 91 | ini_set('arg_separator.output', '&'); |
100 | 92 |
|
101 | 93 | // If login action is set, then set session variables |
|
293 | 285 | } |
294 | 286 | } |
295 | 287 |
|
296 | | - if (!function_exists("htmlspecialchars_decode")) { |
297 | | - function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) { |
298 | | - return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); |
299 | | - } |
300 | | - } |
301 | | - |
302 | 288 | $plugin_manager = new PluginManager($_language); |
303 | | -?> |
0 commit comments