diff --git a/lib/private/Log/ErrorHandler.php b/lib/private/Log/ErrorHandler.php index 3f4c9ee64b100..5c84c61e7441d 100644 --- a/lib/private/Log/ErrorHandler.php +++ b/lib/private/Log/ErrorHandler.php @@ -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) { diff --git a/tests/lib/ErrorHandlerTest.php b/tests/lib/ErrorHandlerTest.php index 702f64bfb99bc..ea53e67005c21 100644 --- a/tests/lib/ErrorHandlerTest.php +++ b/tests/lib/ErrorHandlerTest.php @@ -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'], ]; }