Doc #80349 [NEW]: data:// URI wrapper is afected by allow_url_fopen
From: leon at leonmelis dot nl
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:data:// URI wrapper is afected by allow_url_fopen
Description:
------------
---
From manual page: https://php.net/wrappers.data
---
Documentation states that data:// urls are not affected by
allow_url_fopen, but they are. See attached test script and outcomes.
Tested on PHP 7.2 and PHP 7.4. Both gave same result
Test script:
---------------
<?php
// Test with:
// php -d allow_url_fopen=0 test.php
$data = file_get_contents('data://text/plain,foo');
echo $data . PHP_EOL;
Expected result:
----------------
$> php -d allow_url_fopen=0 test.php
foo
Actual result:
--------------
$> php -d allow_url_fopen=0 test.php
PHP Warning: file_get_contents(): data:// wrapper is disabled in the
server configuration by allow_url_fopen=0 in test.php on line 3
PHP Stack trace:
PHP 1. {main}() test.php:0
PHP 2. file_get_contents() test.php:3
PHP Warning: file_get_contents(data:text/plain,foo): failed to open
stream: no suitable wrapper could be found in test.php on line 3
PHP Stack trace:
PHP 1. {main}() test.php:0
PHP 2. file_get_contents() test.php:3
--
Edit bug report at https://bugs.php.net/bug.php?id=80349&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80349&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80349&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80349&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80349&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80349&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80349&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80349&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80349&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80349&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80349&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80349&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80349&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80349&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80349&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80349&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80349&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80349&r=mysqlcfg
Thread (3 messages)
- leon at leonmelis dot nl