From 5ed0602ec622274bf5672304ae414e5ecb2e5167 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Tue, 22 Sep 2020 13:01:32 +0200 Subject: Fix #76943: Inconsistent stream_wrapper_restore() errors If restoring of any not registered built-in wrapper is requested, the function is supposed to fail with a warning, so we have to check this condition first. Furthermore, to be able to detect whether a built-in wrapper has been changed, it is not sufficient to check whether *any* userland wrapper has been registered, but rather whether the specific wrapper has been modified. Closes GH-6183. --- ext/standard/tests/streams/bug76943.phpt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ext/standard/tests/streams/bug76943.phpt (limited to 'ext/standard/tests/streams') diff --git a/ext/standard/tests/streams/bug76943.phpt b/ext/standard/tests/streams/bug76943.phpt new file mode 100644 index 0000000000..755c348f86 --- /dev/null +++ b/ext/standard/tests/streams/bug76943.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #76943 (Inconsistent stream_wrapper_restore() errors) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in %s on line %d +bool(false) + +Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in %s on line %d +bool(true) + +Warning: stream_wrapper_restore(): foo:// never existed, nothing to restore in %s on line %d +bool(false) + +Notice: stream_wrapper_restore(): phar:// was never changed, nothing to restore in %s on line %d +bool(true) -- cgit v1.2.1