fix typo and typehint

This commit is contained in:
o.pinke 2023-07-04 17:09:34 +02:00
parent 2e386d7c41
commit 46c1c1c3c3
2 changed files with 26 additions and 27 deletions

View file

@ -133,6 +133,4 @@ match ($iStep) {
'doupgrade' => checkAndInclude('steps/upgrade/doupgrade.php'),
'doinstall' => checkAndInclude('steps/setup/doinstall.php'),
default => checkAndInclude('steps/languagechooser.php'),
};
?>
};

View file

@ -1,12 +1,12 @@
<?php
/**
* Project:
* Project:
* Contenido Content Management System
*
* Description:
*
* Requirements:
*
* Description:
*
* Requirements:
* @con_php_req 5
*
* @package ContenidoBackendArea
@ -16,17 +16,17 @@
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
*
*
* {@internal
*
*
*
* {@internal
* created unknown
* modified 2008-07-07, bilal arslan, added security fix
* modified 2011-02-08, Dominik Ziegler, removed old PHP compatibility stuff as contenido now requires at least PHP 5
*
* $Id$:
* }}
*
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
@ -41,52 +41,52 @@ define("E_EXTENSION_CANTCHECK", 3);
* canPHPurlfopen: Checks if PHP is able to use
* allow_url_fopen.
*/
function canPHPurlfopen(): bool|string
function canPHPurlfopen(): bool
{
return ini_get("allow_url_fopen");
}
function getPHPDisplayErrorSetting(): bool|string
function getPHPDisplayErrorSetting(): bool
{
return ini_get("display_errors");
}
function getPHPFileUploadSetting(): bool|string
function getPHPFileUploadSetting(): bool
{
return ini_get("file_uploads");
}
function getPHPGPCOrder(): bool|string
function getPHPGPCOrder(): bool
{
return ini_get("gpc_order");
}
function getPHPMagicQuotesRuntime(): bool|string
function getPHPMagicQuotesRuntime(): bool
{
return ini_get("magic_quotes_runtime");
}
function getPHPMagicQuotesSybase(): bool|string
function getPHPMagicQuotesSybase(): bool
{
return ini_get("magic_quotes_sybase");
}
function getPHPMaxExecutionTime(): bool|string
function getPHPMaxExecutionTime(): bool
{
return ini_get("max_execution_time");
}
function getPHPOpenBasedirSetting(): bool|string
function getPHPOpenBasedirSetting(): bool
{
return ini_get("open_basedir");
}
function checkPHPSQLSafeMode(): bool|string
function checkPHPSQLSafeMode(): bool
{
return ini_get("sql.safe_mode");
}
function return_bytes($val): float|int|string
function return_bytes($val): float|int
{
if (strlen($val) == 0) {
return 0;
@ -94,13 +94,14 @@ function return_bytes($val): float|int|string
$val = trim($val);
$last = $val[strlen($val) - 1];
return match ($last) {
'k', 'K' => (int) $val * 1024,
'm', 'M' => (int) $val * 1_048_576,
'k', 'K' => (int)$val * 1024,
'm', 'M' => (int)$val * 1_048_576,
default => $val,
};
}
function isPHPExtensionLoaded($extension) {
function isPHPExtensionLoaded($extension)
{
$value = extension_loaded($extension);
if ($value === true) {
@ -118,7 +119,7 @@ function isPHPExtensionLoaded($extension) {
/**
* Test for PHP compatibility
*
*
* @param string $sVersion phpversion to test
* @return boolean
*/