Merge pull request #5 from olssonm/dev

L5.5 support.
This commit is contained in:
Marcus Olsson 2017-11-09 16:00:57 +01:00 committed by GitHub
commit c54fe77a51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View File

@ -2,6 +2,7 @@ language: php
php:
- 5.6
- 7.0
- 7.1
before_script:
- travis_retry composer self-update

View File

@ -20,13 +20,13 @@
}
],
"require": {
"php" : ">=5.6.0",
"illuminate/support": "~5.3.28|~5.4",
"bjeavons/zxcvbn-php": "^0.3"
"php" : ">=5.6.0|>=7.0",
"illuminate/support": "~5.3.28|~5.4|~5.5",
"bjeavons/zxcvbn-php": "0.3.0"
},
"require-dev": {
"phpunit/phpunit" : "5.7.*",
"orchestra/testbench": "~3.4"
"phpunit/phpunit" : "5.7.*|~6.0",
"orchestra/testbench": "~3.3|~3.4|~3.5"
},
"autoload": {
"psr-4": {
@ -43,7 +43,12 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
"dev-master": "3.x-dev"
},
"laravel": {
"providers": [
"Olssonm\\Zxcvbn\\ZxcvbnServiceProvider"
]
}
},
"minimum-stability": "stable"

View File

@ -28,10 +28,10 @@ class ZxcvbnServiceProvider extends ServiceProvider
}
return ($zxcvbn['score'] >= $target);
}, 'Your :input is not secure enough.');
}, 'Your :attribute is not secure enough.');
Validator::replacer('zxcvbn_min', function($message, $attribute, $rule, $parameters) {
$message = str_replace(':input', $attribute, $message);
$message = str_replace(':attribute', $attribute, $message);
return $message;
});
@ -59,10 +59,10 @@ class ZxcvbnServiceProvider extends ServiceProvider
return true;
}, 'Your :input is insecure. It either matches a commonly used password, or you have used a similar username/password combination.');
}, 'Your :attribute is insecure. It either matches a commonly used password, or you have used a similar username/password combination.');
Validator::replacer('zxcvbn_dictionary', function($message, $attribute, $rule, $parameters) {
$message = str_replace(':input', $attribute, $message);
$message = str_replace(':attribute', $attribute, $message);
return $message;
});
}