|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-02-07 22:33 UTC] evert at rooftopsolutions dot nl
Description: ------------ Looks like data: streams are restricted by allow_url_fopen, but the documentation seems to state otherwise.. http://ca2.php.net/manual/en/wrappers.data.php Reproduce code: --------------- php -d allow_url_fopen=0 -r "fopen('data://text/plain,hi','r');" Expected result: ---------------- nothing Actual result: -------------- Warning: fopen(): URL file-access is disabled in the server configuration in Command line code on line 1 Call Stack: 0.0002 47712 1. {main}() Command line code:0 0.0003 47792 2. fopen() Command line code:1 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 19:00:02 2025 UTC |
This bug still exists. I am calling $res = fopen('data://text/plain;base64,' . base64_encode($value), 'r'); And getting this error log: PHP Warning: fopen(): data:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /var/www/htdocs/src/Acme/Component/Doctrine/DBAL/Types/Mediumblob.php on line 27 $ php -v PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar 4 2013 13:11:17) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbHI know this has been dormant for a while, but it continues to be a practical issue 15 years on from when it was begun, and it would be great if it could be moved forward. In the last week I've had to modify some code after finding that this issue prevents a simple local server operation from operating on a server that the system administrators have "secured". My code extracts rotation information from EXIF data saved in images generated by phones etc. as part of a wider image processing utility. To extract the EXIF data I'm using exif_read_data() and this utility only accepts file based inputs. So, as is commonly done, I'm using the data:// wrapper to convert an image that is already in memory to a form that works with exif_read_data() - this sort of thing: exif_read_data('data://' . $mime . ';base64,' . base64_encode($data), null, true, false) This makes no use of remote files yet is prevented from operating on the secured server by the data:// requirement for allow_url_fopen. Suggesting to a sysadmin that they make their server less secure so that an image utility that has no actual need to contact a remote server can correct the rotation of an iPhone image (that was itself read from a local disk) seems like a request that is unlikely to be satisfied. A better solution if it is possible would be to remove the requirement for allow_url_fopen from use of data://.