Misc/Fixups

* use built in function to determine if CLI can use escape codes
 * define _post, _get and _cookie in all cases
 * do not apply 8 regexes to a string that doesn't even contain a UI Sequence
This commit is contained in:
Sarjuuk
2024-03-16 00:17:19 +01:00
parent d37eb9a59b
commit c01c9ce901
3 changed files with 12 additions and 5 deletions

View File

@@ -15,8 +15,8 @@ mb_internal_encoding('UTF-8');
// OS_WIN as per compile info of php
define('OS_WIN', substr(PHP_OS, 0, 3) == 'WIN');
// WIN10 and later support ANSI escape sequences
define('CLI_HAS_E', !OS_WIN || version_compare(php_uname('r'), '10.0') >= 0);
// WIN10 and later usually support ANSI escape sequences
define('CLI_HAS_E', !OS_WIN || (function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT)));
require_once 'includes/defines.php';