mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #26346 from J0WI/clean-auth-regex
Cleaner removePassword regex
This commit is contained in:
commit
ee7a484284
2 changed files with 8 additions and 4 deletions
|
|
@ -39,7 +39,7 @@ class ErrorHandler {
|
|||
* @return string
|
||||
*/
|
||||
protected static function removePassword($msg) {
|
||||
return preg_replace('/\/\/(.*):(.*)@/', '//xxx:xxx@', $msg);
|
||||
return preg_replace('#//(.*):(.*)@#', '//xxx:xxx@', $msg);
|
||||
}
|
||||
|
||||
public static function register($debug = false) {
|
||||
|
|
|
|||
|
|
@ -30,11 +30,15 @@ class ErrorHandlerTest extends \Test\TestCase {
|
|||
*/
|
||||
public function passwordProvider() {
|
||||
return [
|
||||
['user', 'password'],
|
||||
['user@owncloud.org', 'password'],
|
||||
['user', 'pass@word'],
|
||||
['us:er', 'pass@word'],
|
||||
['us:er', 'password'],
|
||||
['user', '-C:R,w)@6*}'],
|
||||
['user', 'pass:word'],
|
||||
['user', 'pass@word'],
|
||||
['user', 'password'],
|
||||
['user:test@cloud', 'password'],
|
||||
['user@owncloud.org', 'password'],
|
||||
['user@test@owncloud.org', 'password'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue