php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64860 Missing documentation for new return value in function is_file
Submitted: 2013-05-16 13:02 UTC Modified: 2015-05-27 17:35 UTC
From: spasic dot dejan at yahoo dot de Assigned:
Status: Open Package: Documentation problem
PHP Version: Irrelevant OS: all
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-05-16 13:02 UTC] spasic dot dejan at yahoo dot de
Description:
------------
PHP 5.4.x

It was added a new return value for the function is_file. When given parameter 
which is given includes a trailing null byte, it returns NULL instead of FALSE. 
This information is missing!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-25 00:19 UTC] philip@php.net
What's the change? Does it affect other file functions? The PHP changelog does not 
mention this (or so it seems) but if there is something to document here then the 
following should also be updated:

http://us2.php.net/manual/en/security.filesystem.nullbytes.php
 [2015-05-27 17:35 UTC] cmb@php.net
As of PHP 5.4.0 function is_file() expects a valid path instead of
a general string (ZPP p instead of s). paths, however, must not
contain null bytes. In case of an invalid pathname a respective
warning is thrown. See also <http://3v4l.org/0TFFl>.

With regard to the return value there's already a note on the
"Internal (built-in) functions" man page[1]:

| If the parameters given to a function are not what it expects,
| such as passing an array where a string is expected, the return
| value of the function is undefined. In this case it will likely
| return NULL but this is just a convention, and cannot be relied
| upon.

I'm not sure if there is the need for further documentation.

[1] <http://php.net/manual/en/functions.internal.php>
 
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Tue Sep 01 06:01:31 2015 UTC