Unregister enc stream wrapper for any exception

This prevents side effects in tests by properly cleaning up
even with expected exceptions.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
pull/28373/head
Vincent Petry 4 years ago
parent 60e44077b7
commit 9c6bbfac45
No known key found for this signature in database
GPG Key ID: E055D6A4D513575C
  1. 2
      lib/private/Files/Stream/Encryption.php

@ -212,7 +212,7 @@ class Encryption extends Wrapper {
} else {
$wrapped = fopen($protocol . '://', $mode, false, $context);
}
} catch (\BadMethodCallException $e) {
} catch (\Exception $e) {
stream_wrapper_unregister($protocol);
throw $e;
}

Loading…
Cancel
Save