mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-09 11:08:34 +01:00
add function isDolValidTms
This commit is contained in:
@@ -234,6 +234,25 @@ function isModEnabled($module)
|
|||||||
//return !empty($conf->$module->enabled);
|
//return !empty($conf->$module->enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* isDolValidTms check if a timestamp is valid.
|
||||||
|
*
|
||||||
|
* @param int|string|null $timestamp
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function isDolValidTms($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).
|
* Return a DoliDB instance (database handler).
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user