From: Nikita Popov Date: Mon, 26 Oct 2020 15:51:53 +0000 (+0100) Subject: Merge branch 'PHP-7.4' into PHP-8.0 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70388cc0edf91acd3899860798fcf418928a9fb4;p=php Merge branch 'PHP-7.4' into PHP-8.0 * PHP-7.4: Deny cloning of fileinfo objects --- 70388cc0edf91acd3899860798fcf418928a9fb4 diff --cc ext/fileinfo/tests/clone_serialize.phpt index 0000000000,5375526ee4..dec16a485e mode 000000,100644..100644 --- a/ext/fileinfo/tests/clone_serialize.phpt +++ b/ext/fileinfo/tests/clone_serialize.phpt @@@ -1,0 -1,27 +1,25 @@@ + --TEST-- + Cloning and serializing finfo is not supported + --FILE-- + buffer("Test string")); + try { + $finfo2 = clone $finfo; + var_dump($finfo2->buffer("Test string")); + } catch (Error $e) { + echo $e->getMessage(), "\n"; + } + try { + $finfo3 = unserialize(serialize($finfo)); + var_dump($finfo3->buffer("Test string")); + } catch (Error $e) { + echo $e->getMessage(), "\n"; + } + + ?> + --EXPECTF-- + string(%d) "%s" + Trying to clone an uncloneable object of class finfo - -Warning: finfo::buffer(): The invalid fileinfo object. in %s on line %d -bool(false) ++Invalid finfo object