]> granicus.if.org Git - php/commit
SplFileObject does not accept directories. It did not check for that and blindly...
authorEtienne Kneuss <colder@php.net>
Thu, 8 Sep 2011 15:52:59 +0000 (15:52 +0000)
committerEtienne Kneuss <colder@php.net>
Thu, 8 Sep 2011 15:52:59 +0000 (15:52 +0000)
commit3afb143e65060879fbd410895834b6ed1e720119
tree326c52a2594f88b5fbfab7fb9af69dc4f7de7693
parent9103c93606daec1af7997d7dcb9baeaaeb468b01
SplFileObject does not accept directories. It did not check for that and blindly opened the directory, which works on linux but fails on windows. Now SplFileObject uses a stat() call to make sure it isn't a directory, if it is, it fails with an exception. Tests have been changed accordingly.
ext/spl/spl_directory.c
ext/spl/tests/SplFileObject_fflush_basic_001.phpt
ext/spl/tests/SplFileObject_ftruncate_error_001.phpt
ext/spl/tests/fileobject_003.phpt