diff --git a/htdocs/core/lib/public.lib.php b/htdocs/core/lib/public.lib.php index ecc75de10da..0ce710517de 100644 --- a/htdocs/core/lib/public.lib.php +++ b/htdocs/core/lib/public.lib.php @@ -30,11 +30,11 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; /** - * Check if the object exceeded the number of posts for a specific ip - * @param object $object Object to check - * @param int $nb_post_max Number max of posts + * Check if the object exceeded the number of posts for a specific ip in the same week * - * @return int return <0 if error, >0 if OK + * @param object $object Object to check + * @param int $nb_post_max Number max of posts + * @return int Return <0 if error, >0 if OK */ function checkNbPostsForASpeceificIp($object, $nb_post_max) { @@ -42,7 +42,7 @@ function checkNbPostsForASpeceificIp($object, $nb_post_max) $nb_post_ip = 0; $now = dol_now(); - $minmonthpost = dol_time_plus_duree($now, -1, "m"); + $minmonthpost = dol_time_plus_duree($now, -1, "w"); if (empty($object->ip)) { $object->ip = getUserRemoteIP();