2
0
forked from Wavyzz/dolibarr

Merge pull request #27522 from frederic34/patch-11

add function isDolTms
This commit is contained in:
Laurent Destailleur
2024-01-18 21:38:45 +01:00
committed by GitHub
2 changed files with 23 additions and 4 deletions

View File

@@ -234,6 +234,25 @@ function isModEnabled($module)
//return !empty($conf->$module->enabled);
}
/**
* isDolTms check if a timestamp is valid.
*
* @param int|string|null $timestamp timestamp to check
* @return bool
*/
function isDolTms($timestamp)
{
if ($timestamp === '') {
dol_syslog('Using empty string for a timestamp is deprecated, prefer use of null when calling page '.$_SERVER["PHP_SELF"], LOG_NOTICE);
return false;
}
if (is_null($timestamp) || !is_numeric($timestamp)) {
return false;
}
return true;
}
/**
* Return a DoliDB instance (database handler).
*