User: fixed a bug that allowed the date of birth to be set later than the present

This commit is contained in:
0x7d5 2021-09-13 23:54:35 +05:00
parent bda20336b8
commit 78fbb1d00e
2 changed files with 2 additions and 2 deletions

View file

@ -102,7 +102,7 @@ final class UserPresenter extends OpenVKPresenter
$user->setLast_Name(empty($this->postParam("last_name")) ? "" : $this->postParam("last_name"));
$user->setPseudo(empty($this->postParam("pseudo")) ? NULL : $this->postParam("pseudo"));
$user->setStatus(empty($this->postParam("status")) ? NULL : $this->postParam("status"));
if (strtotime($this->postParam("birthday")) > 10)
if (strtotime($this->postParam("birthday")) < time())
$user->setBirthday(strtotime($this->postParam("birthday")));
if ($this->postParam("marialstatus") <= 8 && $this->postParam("marialstatus") >= 0)

View file

@ -135,7 +135,7 @@
<span class="nobold">День рождения: </span>
</td>
<td>
<input name="birthday" value={gmdate("Y-m-d", $user->getBirthday())} type="date"/>
<input max={date('Y-m-d')} name="birthday" value={gmdate("Y-m-d", $user->getBirthday())} type="date"/>
</td>
</tr>
<tr>