mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 17:23:04 +02:00
feature 1915: add protection on user registration against robots
git-svn-id: http://piwigo.org/svn/trunk@7495 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -119,14 +119,7 @@ SELECT COUNT(*) AS user_exists
|
||||
$comment_action='reject';
|
||||
}
|
||||
|
||||
$key = explode( ':', @$key );
|
||||
if ( count($key)!=2
|
||||
or $key[0]>time()-2 // page must have been retrieved more than 2 sec ago
|
||||
or $key[0]<time()-3600 // 60 minutes expiration
|
||||
or hash_hmac(
|
||||
'md5', $key[0].':'.$comm['image_id'], $conf['secret_key']
|
||||
) != $key[1]
|
||||
)
|
||||
if ( !verify_ephemeral_key(@$key, $comm['image_id']) )
|
||||
{
|
||||
$comment_action='reject';
|
||||
}
|
||||
@@ -248,13 +241,7 @@ function update_user_comment($comment, $post_key)
|
||||
|
||||
$comment_action = 'validate';
|
||||
|
||||
$key = explode( ':', $post_key );
|
||||
if ( count($key)!=2
|
||||
or $key[0]>time()-2 // page must have been retrieved more than 2 sec ago
|
||||
or $key[0]<time()-3600 // 60 minutes expiration
|
||||
or hash_hmac('md5', $key[0].':'.$comment['image_id'], $conf['secret_key']
|
||||
) != $key[1]
|
||||
)
|
||||
if ( !verify_ephemeral_key($post_key, $comment['image_id']) )
|
||||
{
|
||||
$comment_action='reject';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user