Update pendingregist.php

no more tokens containing slashes to prevent problems URL generation error ("token" for route "registration.register.verifyToken" must match "[^/]++")
This commit is contained in:
j2L4e 2015-07-20 14:08:24 +02:00
parent a0ac90e257
commit 29379c373d
1 changed files with 5 additions and 1 deletions

View File

@ -21,7 +21,11 @@ class PendingRegist {
public function save($email) { public function save($email) {
$query = $this->db->prepareQuery( 'INSERT INTO `*PREFIX*registration`' $query = $this->db->prepareQuery( 'INSERT INTO `*PREFIX*registration`'
.' ( `email`, `token`, `requested` ) VALUES( ?, ?, NOW() )' ); .' ( `email`, `token`, `requested` ) VALUES( ?, ?, NOW() )' );
$token = $this->random->generate(30);
do {
$token = $this->random->generate(30);
} while (preg_match('/[\/]++/', $token));
$query->execute(array( $email, $token )); $query->execute(array( $email, $token ));
return $token; return $token;
} }