Browse Source

return false, if token is not found in database

master
Dom SP 3 years ago
parent
commit
0a8fde4e56
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      app/controller/email.php

+ 8
- 5
app/controller/email.php View File

$db = new \DB\Jig($token_db,\DB\Jig::FORMAT_JSON); $db = new \DB\Jig($token_db,\DB\Jig::FORMAT_JSON);
$formcall = new \DB\Jig\Mapper($db,'form_calls'); $formcall = new \DB\Jig\Mapper($db,'form_calls');


$formcall->load(['@token = ?', $token]);
$f3->config($formcall->form);
$this->path = $formcall->path;

return true;
if($formcall->load(['@token = ?', $token])) {
$f3->config($formcall->form);
$this->path = $formcall->path;
return true;
} else {
return false;
}
} }
function get_post_data() { function get_post_data() {
$f3 = \Base::instance(); $f3 = \Base::instance();
$token = $f3->get('POST.xss-token'); $token = $f3->get('POST.xss-token');
if (ctype_alnum( $token )) { if (ctype_alnum( $token )) {
if ($this->load_form_config($token)) { if ($this->load_form_config($token)) {

Loading…
Cancel
Save