diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-05-02 16:57:24 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-05-03 12:19:37 +0200 |
commit | 69888c3ff1f2301ead8e37b23ff8481d475e29d2 (patch) | |
tree | 0f3a4d9963fc1aaf642d2524b73b57f332cc94b8 /ext/standard | |
parent | 34f727e63716dfb798865289c079b017812ad03b (diff) | |
download | php-git-69888c3ff1f2301ead8e37b23ff8481d475e29d2.tar.gz |
Fix #79467: data:// wrappers are writable
Despite the docs claiming that data: wrappers would not be writable[1],
they are implemented as writing to a memory stream. That does not seem
to be particularly sensible, so we disallow writing altogether.
[1] <https://www.php.net/manual/en/wrappers.data.php#refsect1-wrappers.data-options>
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/tests/streams/bug79467.phpt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/standard/tests/streams/bug79467.phpt b/ext/standard/tests/streams/bug79467.phpt new file mode 100644 index 0000000000..061160173d --- /dev/null +++ b/ext/standard/tests/streams/bug79467.phpt @@ -0,0 +1,9 @@ +--TEST-- +Bug #79467 (data:// wrappers are writable) +--FILE-- +<?php +var_dump(file_put_contents('data://text/plain,cccc', 'data')); +?> +--EXPECTF-- +Notice: file_put_contents(): Stream is not writable in %s on line %d +bool(false) |