diff --git a/module/common/model.php b/module/common/model.php index ced20d4eb0..3ecdd29e41 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1750,11 +1750,15 @@ EOD; /* Change for task #5384. */ if(isset($queryString['time'])) { + $timestamp = $queryString['time']; + if(strlen($timestamp) > 10) $timestamp = substr($timestamp, 0, 10); + if(strlen($timestamp) != 10 or $timestamp{0} >= '4') $this->response('ERROR_TIMESTAMP'); + $result = $this->get->token == md5($entry->code . $entry->key . $queryString['time']); if($result) { - if($queryString['time'] <= $entry->calledTime) $this->response('CALLED_TIME'); - $this->loadModel('entry')->updateTime($entry->code, $queryString['time']); + if($timestamp <= $entry->calledTime) $this->response('CALLED_TIME'); + $this->loadModel('entry')->updateTime($entry->code, $timestamp); unset($_GET['time']); return $result; } diff --git a/module/entry/config.php b/module/entry/config.php index 1d4f988665..e1c22ce1cc 100644 --- a/module/entry/config.php +++ b/module/entry/config.php @@ -16,3 +16,4 @@ $config->entry->errcode['ACCOUNT_UNBOUND'] = 403; $config->entry->errcode['EMPTY_ENTRY'] = 404; $config->entry->errcode['CALLED_TIME'] = 405; $config->entry->errcode['INVALID_ACCOUNT'] = 406; +$config->entry->errcode['ERROR_TIMESTAMP'] = 407; diff --git a/module/entry/lang/de.php b/module/entry/lang/de.php index e0ac98e08c..9b8f58827b 100644 --- a/module/entry/lang/de.php +++ b/module/entry/lang/de.php @@ -54,3 +54,5 @@ $lang->entry->errmsg['IP_DENIED'] = 'IP ist unzulässig.'; $lang->entry->errmsg['ACCOUNT_UNBOUND'] = 'Account is not bound.'; $lang->entry->errmsg['INVALID_ACCOUNT'] = 'Account is not exists'; $lang->entry->errmsg['EMPTY_ENTRY'] = 'Key des Eintrags fehlt.'; +$lang->entry->errmsg['CALLED_TIME'] = 'Token has expired'; +$lang->entry->errmsg['ERROR_TIMESTAMP'] = 'Timestamp Error'; diff --git a/module/entry/lang/en.php b/module/entry/lang/en.php index 382096c434..2aa4ef748e 100644 --- a/module/entry/lang/en.php +++ b/module/entry/lang/en.php @@ -55,3 +55,4 @@ $lang->entry->errmsg['ACCOUNT_UNBOUND'] = 'Account is not bound.'; $lang->entry->errmsg['INVALID_ACCOUNT'] = 'Invalid account.'; $lang->entry->errmsg['EMPTY_ENTRY'] = 'Application does not exist.'; $lang->entry->errmsg['CALLED_TIME'] = 'Token has expired'; +$lang->entry->errmsg['ERROR_TIMESTAMP'] = 'Timestamp Error'; diff --git a/module/entry/lang/zh-cn.php b/module/entry/lang/zh-cn.php index ce4cd7e660..de4b94ebda 100644 --- a/module/entry/lang/zh-cn.php +++ b/module/entry/lang/zh-cn.php @@ -55,3 +55,4 @@ $lang->entry->errmsg['ACCOUNT_UNBOUND'] = '未绑定用户'; $lang->entry->errmsg['INVALID_ACCOUNT'] = '用户不存在'; $lang->entry->errmsg['EMPTY_ENTRY'] = '应用不存在'; $lang->entry->errmsg['CALLED_TIME'] = 'Token已失效'; +$lang->entry->errmsg['ERROR_TIMESTAMP'] = '错误的时间戳。'; diff --git a/module/entry/lang/zh-tw.php b/module/entry/lang/zh-tw.php index 73d9bab040..319d75d6ee 100644 --- a/module/entry/lang/zh-tw.php +++ b/module/entry/lang/zh-tw.php @@ -55,3 +55,4 @@ $lang->entry->errmsg['ACCOUNT_UNBOUND'] = '未綁定用戶'; $lang->entry->errmsg['INVALID_ACCOUNT'] = '用戶不存在'; $lang->entry->errmsg['EMPTY_ENTRY'] = '應用不存在'; $lang->entry->errmsg['CALLED_TIME'] = 'Token已失效'; +$lang->entry->errmsg['ERROR_TIMESTAMP'] = '錯誤的時間戳。';