Я понял.
size_t found = text.find('.');
text.erase(found, 1);
Я не уверен на 100%, что я понял ваши потребности, но обеспечение сброса пароля и тайм-аута в функции сброса может быть выполнено путем рефакторинга связанного кода с приведенным ниже. Это может быть одним из способов ...
// КАК ЕСТЬ
// Clear passkey and timeout
$this->request->data['passkey'] = null;
$this->request->data['timeout'] = null;
$user = $this->Users->patchEntity($user, $this->request->data);
if ($this->Users->save($user)) {
…
// ЭТОМУ
$user = $this->Users->patchEntity($user, $this->request->getData());
// Clear passkey and timeout
$user->passkey = null;
$user->timeout = null;
if ($this->Users->save($user)) {
…