Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/private/Log/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 7 additions & 3 deletions tests/lib/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ class ErrorHandlerTest extends \Test\TestCase {
*/
public function passwordProvider() {
return [
['user', 'password'],
['[email protected]', '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'],
['[email protected]', 'password'],
['user@[email protected]', 'password'],
];
}

Expand Down