Doc #80349 [Opn->Ver]: data:// URI wrapper is afected by allow_url_fopen

From: Date: Tue, 10 Nov 2020 16:36:18 +0000
Subject: Doc #80349 [Opn->Ver]: data:// URI wrapper is afected by allow_url_fopen
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18115@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80349&edit=1 ID: 80349 Updated by: cmb@php.net Reported by: leon at leonmelis dot nl Summary: data:// URI wrapper is afected by allow_url_fopen -Status: Open +Status: Verified Type: Documentation Problem -Package: Documentation problem +Package: Streams related PHP Version: Irrelevant -Assigned To: +Assigned To: cmb Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2020-11-10 16:23:01] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80349&edit=1

« previous php.doc.bugs (#18115) next »