Bug #0002219: Compatibilité PHP 8.2 , 8.1 , 8.0

This commit is contained in:
sparkyx 2023-02-01 16:49:24 +01:00
parent 1c7f0086a6
commit 21b1cb3d84
36 changed files with 103 additions and 100 deletions

View file

@ -235,7 +235,7 @@ function isNumber($p_int)
function isDate($p_date)
{
if (strlen(trim($p_date)) == 0)
if (noalyss_strlentrim($p_date) == 0)
return null;
if (preg_match("/^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}$/", $p_date) == 0)
{
@ -1474,7 +1474,7 @@ function generate_random_string($car)
$string="";
$chaine="abcdefghijklmnpqrstuvwxyABCDEFGHIJKLMNPQRSTUVWXY0123456789*/+-=";
srand((float) microtime(true)*1020030);
for ($i=0; $i<$car; $i++)
for ($i=0; $i<$p_length; $i++)
{
$string .= $chaine[rand()%strlen($chaine)];
}
@ -1593,6 +1593,10 @@ function noalyss_trim($p_string) {
if ($p_string===null) return "";
else return trim($p_string);
}
function noalyss_strlentrim($p_string) :int {
if (empty($p_string)) return 0;
return strlen(trim($p_string));
}
function noalyss_str_replace($search,$replace,$string) {
if ($string===null) return "";
else return str_replace($search,$replace,$string);