Bug #69275 [Asn]: SplFileObject constructor cannot be overridden

From: Date: Sat, 07 Nov 2020 13:24:54 +0000
Subject: Bug #69275 [Asn]: SplFileObject constructor cannot be overridden
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230174@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69275&edit=1

 ID:                 69275
 Updated by:         cmb@php.net
 Reported by:        stephen dot reay at me dot com
 Summary:            SplFileObject constructor cannot be overridden
 Status:             Assigned
 Type:               Bug
 Package:            *General Issues
 Operating System:   OS X, Linux
 PHP Version:        5.6.7
 Assigned To:        danack
 Block user comment: N
 Private report:     N

 New Comment:

This issue has been fixed with commit fe88d23914[1], available as
of PHP 8.0.0.

[1] <https://github.com/php/php-src/commit/fe88d23914e4185daffe858d01067beada34cdca>


Previous Comments:
------------------------------------------------------------------------
[2018-08-19 09:30:02] stephen dot reay at me dot com

It's been over three years since the patch was attached, and despite the GH PR being closed as
"targets a security fix only branch", this is still present in 7.3.

Is there any chance of getting more eyeballs on this before the end of the decade?

------------------------------------------------------------------------
[2015-03-24 19:51:47] danack@php.net

PR is attached - as it changes the Zend engine to allow functions that contain more than 2
parameters to be easily callable, it needs some more eyes on it.

------------------------------------------------------------------------
[2015-03-24 13:15:44] danack@php.net

I'm looking at it yes.

Whether I'm able to fix it, is a question yet to be determined.

------------------------------------------------------------------------
[2015-03-24 05:44:45] laruence@php.net

@danack are you able to make a patch? thanks

------------------------------------------------------------------------
[2015-03-22 19:23:00] danack@php.net

The cause is pretty clear. When the class is the standard SplFileObject the parameters passed to
openFile are read and passed to the file open call.
http://lxr.php.net/xref/PHP_5_6/ext/spl/spl_directory.c#537

When the class isn't that class, the params aren't parsed and instead the mode is set to
'r' only:
http://lxr.php.net/xref/PHP_5_6/ext/spl/spl_directory.c#524

Which obviously causes the file opening to fail, as the file doesn't exist.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=69275


--
Edit this bug report at https://bugs.php.net/bug.php?id=69275&edit=1


Thread (7 messages)

« previous php.bugs (#230174) next »