diff options
Diffstat (limited to 'include/functions.php')
| -rw-r--r-- | include/functions.php | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/include/functions.php b/include/functions.php index 538239218..41d6e5853 100644 --- a/include/functions.php +++ b/include/functions.php @@ -7,6 +7,10 @@ define('COOKIE_LIFETIME_LONG', 86400*365); + // this CSS file is included for everyone (if it exists in themes.local) + // on login, registration, and main (index and prefs) pages + define('LOCAL_OVERRIDE_STYLESHEET', '.local-overrides.css'); + $fetch_last_error = false; $fetch_last_error_code = false; $fetch_last_content_type = false; @@ -14,7 +18,10 @@ $fetch_effective_url = false; $fetch_curl_used = false; - libxml_disable_entity_loader(true); + if (version_compare(PHP_VERSION, '8.0.0', '<')) { + libxml_disable_entity_loader(true); + } + libxml_use_internal_errors(true); // separate test because this is included before sanity checks @@ -323,7 +330,7 @@ function sanity_check() { require_once 'errors.php'; - global $ERRORS; + $ERRORS = get_error_types(); $error_code = 0; $schema_version = get_schema_version(true); @@ -389,17 +396,16 @@ return uniqid(base_convert(rand(), 10, 36)); } - function trim_array($array) { - $tmp = $array; - array_walk($tmp, 'trim'); - return $tmp; - } - function T_sprintf() { $args = func_get_args(); return vsprintf(__(array_shift($args)), $args); } + function T_nsprintf() { + $args = func_get_args(); + return vsprintf(_ngettext(array_shift($args), array_shift($args), array_shift($args)), $args); + } + function is_server_https() { return (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')) || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'; } @@ -536,7 +542,7 @@ */ function error_json($code) { require_once "errors.php"; - global $ERRORS; + $ERRORS = get_error_types(); @$message = $ERRORS[$code]; |