@@ -277,9 +277,9 @@ discard block |
||
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | return $api ? [ |
| 280 | - 'sensitive' => $generator['sensitive'], |
|
| 281 | - 'key' => $generator['key'], |
|
| 282 | - 'img' => $this->image->encode('data-url')->encoded |
|
| 280 | + 'sensitive' => $generator['sensitive'], |
|
| 281 | + 'key' => $generator['key'], |
|
| 282 | + 'img' => $this->image->encode('data-url')->encoded |
|
| 283 | 283 | ] : $this->image->response('png', $this->quality); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -317,9 +317,9 @@ discard block |
||
| 317 | 317 | ]); |
| 318 | 318 | |
| 319 | 319 | return [ |
| 320 | - 'value' => $bag, |
|
| 321 | - 'sensitive' => $this->sensitive, |
|
| 322 | - 'key' => $hash |
|
| 320 | + 'value' => $bag, |
|
| 321 | + 'sensitive' => $this->sensitive, |
|
| 322 | + 'key' => $hash |
|
| 323 | 323 | ]; |
| 324 | 324 | } |
| 325 | 325 | |
@@ -419,26 +419,26 @@ discard block |
||
| 419 | 419 | return $this->image; |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | - /** |
|
| 423 | - * Captcha check |
|
| 424 | - * |
|
| 425 | - * @param $value |
|
| 426 | - * @return bool |
|
| 427 | - */ |
|
| 428 | - public function check($value) |
|
| 429 | - { |
|
| 430 | - if ( ! $this->session->has('captcha')) |
|
| 431 | - { |
|
| 432 | - return false; |
|
| 433 | - } |
|
| 422 | + /** |
|
| 423 | + * Captcha check |
|
| 424 | + * |
|
| 425 | + * @param $value |
|
| 426 | + * @return bool |
|
| 427 | + */ |
|
| 428 | + public function check($value) |
|
| 429 | + { |
|
| 430 | + if ( ! $this->session->has('captcha')) |
|
| 431 | + { |
|
| 432 | + return false; |
|
| 433 | + } |
|
| 434 | 434 | |
| 435 | - $key = $this->session->get('captcha.key'); |
|
| 436 | - $sensitive = $this->session->get('captcha.sensitive'); |
|
| 435 | + $key = $this->session->get('captcha.key'); |
|
| 436 | + $sensitive = $this->session->get('captcha.sensitive'); |
|
| 437 | 437 | |
| 438 | - if ( ! $sensitive) |
|
| 439 | - { |
|
| 440 | - $value = $this->str->lower($value); |
|
| 441 | - } |
|
| 438 | + if ( ! $sensitive) |
|
| 439 | + { |
|
| 440 | + $value = $this->str->lower($value); |
|
| 441 | + } |
|
| 442 | 442 | |
| 443 | 443 | |
| 444 | 444 | $res = $this->hasher->check($value, $key); |
@@ -448,18 +448,18 @@ discard block |
||
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | return $res; |
| 451 | - } |
|
| 452 | - |
|
| 453 | - /** |
|
| 454 | - * Captcha check |
|
| 455 | - * |
|
| 456 | - * @param $value |
|
| 457 | - * @return bool |
|
| 458 | - */ |
|
| 459 | - public function check_api($value, $key) |
|
| 460 | - { |
|
| 461 | - return $this->hasher->check($value, $key); |
|
| 462 | - } |
|
| 451 | + } |
|
| 452 | + |
|
| 453 | + /** |
|
| 454 | + * Captcha check |
|
| 455 | + * |
|
| 456 | + * @param $value |
|
| 457 | + * @return bool |
|
| 458 | + */ |
|
| 459 | + public function check_api($value, $key) |
|
| 460 | + { |
|
| 461 | + return $this->hasher->check($value, $key); |
|
| 462 | + } |
|
| 463 | 463 | |
| 464 | 464 | /** |
| 465 | 465 | * Generate captcha image source |