aboutsummaryrefslogtreecommitdiffstats
path: root/mod/register.php
diff options
context:
space:
mode:
authorOlivier van Helden <olivier@van-helden.net>2014-12-03 17:54:07 -0400
committerOlivier van Helden <olivier@van-helden.net>2014-12-03 17:54:07 -0400
commite523061b7261439a71bdacf8f46d4c614740b356 (patch)
tree1a0577c64197c4289ed154d2c2d5fdf48a7e5192 /mod/register.php
parent13fd91d6f5723774a1b96257f8096acb2873b4ed (diff)
parentb71b45aafc618d32d23c099a4d4db8bad2f09e54 (diff)
downloadvolse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.tar.gz
volse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.tar.bz2
volse-hubzilla-e523061b7261439a71bdacf8f46d4c614740b356.zip
Merge pull request #1 from friendica/master
Merge master from friendica
Diffstat (limited to 'mod/register.php')
-rw-r--r--mod/register.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/mod/register.php b/mod/register.php
index 0cf1364b5..70bdcf350 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -37,7 +37,9 @@ function register_post(&$a) {
$max_dailies = intval(get_config('system','max_daily_registrations'));
if($max_dailies) {
- $r = q("select count(account_id) as total from account where account_created > UTC_TIMESTAMP() - INTERVAL 1 day");
+ $r = q("select count(account_id) as total from account where account_created > %s - INTERVAL %s",
+ db_utcnow(), db_quoteinterval('1 day')
+ );
if($r && $r[0]['total'] >= $max_dailies) {
notice( t('Maximum daily site registrations exceeded. Please try again tomorrow.') . EOL);
return;
@@ -100,7 +102,7 @@ function register_post(&$a) {
$invite_code = ((x($_POST,'invite_code')) ? notags(trim($_POST['invite_code'])) : '');
if($using_invites && $invite_code) {
- q("delete * from register where hash = '%s' limit 1", dbesc($invite_code));
+ q("delete * from register where hash = '%s'", dbesc($invite_code));
set_pconfig($result['account']['account_id'],'system','invites_remaining',$num_invites);
}
@@ -164,7 +166,9 @@ function register_content(&$a) {
$max_dailies = intval(get_config('system','max_daily_registrations'));
if($max_dailies) {
- $r = q("select count(account_id) as total from account where account_created > UTC_TIMESTAMP() - INTERVAL 1 day");
+ $r = q("select count(account_id) as total from account where account_created > %s - INTERVAL %s",
+ db_utcnow(), db_quoteinterval('1 day')
+ );
if($r && $r[0]['total'] >= $max_dailies) {
logger('max daily registrations exceeded.');
notice( t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);