php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80349 data:// URI wrapper is afected by allow_url_fopen
Submitted: 2020-11-10 16:23 UTC Modified: 2020-11-10 16:36 UTC
From: leon at leonmelis dot nl Assigned: cmb (profile)
Status: Closed Package: Streams related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: leon at leonmelis dot nl
New email:
PHP Version: OS:

 

 [2020-11-10 16:23 UTC] leon at leonmelis dot nl
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-10 16:36 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Documentation problem +Package: Streams related -Assigned To: +Assigned To: cmb
 [2020-11-10 16:52 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=fc8735b2e20d775deaca34a680d728c83153cd21
Log: Fix #80349: data:// URI wrapper is afected by allow_url_fopen
 [2020-11-10 16:52 UTC] phpdocbot@php.net
-Status: Verified +Status: Closed
 [2020-11-10 21:40 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=357a1fd2b2372077efb01926d60e88f469fa11b1
Log: Fix #80349: data:// URI wrapper is afected by allow_url_fopen
 [2020-12-30 11:58 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=5cda23a7f40c4086131ff046ca3fa415843042ce
Log: Fix #80349: data:// URI wrapper is afected by allow_url_fopen
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 20:01:29 2024 UTC