mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Changed Validation::cc() so custom regex match will call Validation::_luhn()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3845 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
57ef07a04d
commit
a046a338bb
1 changed files with 6 additions and 1 deletions
|
@ -183,7 +183,9 @@ class Validation extends Object {
|
|||
}
|
||||
|
||||
if(!is_null($this->regex)) {
|
||||
return $this->_check();
|
||||
if($this->_check()) {
|
||||
return $this->_luhn();
|
||||
}
|
||||
}
|
||||
|
||||
$cards = array('all' => array('amex' => '/^3[4|7]\\d{13}$/',
|
||||
|
@ -238,6 +240,9 @@ class Validation extends Object {
|
|||
*/
|
||||
function _luhn() {
|
||||
if($this->deep === true){
|
||||
if($this->check == 0) {
|
||||
return false;
|
||||
}
|
||||
$sum = 0;
|
||||
$length = strlen($this->check);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue