Skip to content

Commit

Permalink
missing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cake17 committed Apr 28, 2018
1 parent 3325f0d commit 5009d0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/View/Helper/RecaptchaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ public function __construct(View $view, $config = [])
parent::__construct($view, $config);

// Merge Options given by user in config/recaptcha
$this->config(Configure::read('Recaptcha'));
$this->setConfig(Configure::read('Recaptcha'));

$lang = $this->getConfig('lang');
if (empty($lang)) {
$this->setConfig('lang', I18n::locale());
}
// Validate the Configure Data
$validator = new RecaptchaValidator();
$errors = $validator->setErrors($this->getConfig());
$errors = $validator->errors($this->getConfig());
if (!empty($errors)) {
throw new \Exception(__d('recaptcha', 'One of your recaptcha config value is incorrect'));
// throw an exception with config error that is raised
}

// Make sure the secret param is
$this->config('secret', '');
$this->setConfig('secret', '');
}

/**
Expand All @@ -95,7 +95,7 @@ public function display(array $options = [])

// Validate the Configure Data
$validator = new RecaptchaValidator();
$errors = $validator->setErrors($options);
$errors = $validator->errors($options);
if (!empty($errors)) {
throw new \Exception(__d('recaptcha', 'One of your recaptcha config value is incorrect'));
// throw an exception with config error that is raised
Expand Down Expand Up @@ -137,7 +137,7 @@ public function widget(array $options = [])

// Validate the Configure Data
$validator = new RecaptchaValidator();
$errors = $validator->setErrors($options);
$errors = $validator->errors($options);
if (!empty($errors)) {
throw new \Exception(__d('recaptcha', 'One of your recaptcha config value is incorrect in a widget'));
// throw an exception with config error that is raised
Expand Down

0 comments on commit 5009d0b

Please sign in to comment.