fix typo and typehint

Dieser Commit ist enthalten in:
o.pinke 2023-07-04 17:09:34 +02:00
Ursprung 2e386d7c41
Commit 46c1c1c3c3
2 geänderte Dateien mit 26 neuen und 27 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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