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

From: Date: Tue, 10 Nov 2020 16:52:11 +0000
Subject: Doc #80349 [Ver->Csd]: data:// URI wrapper is afected by allow_url_fopen
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18116@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: phpdocbot@php.net Reported by: leon at leonmelis dot nl Summary: data:// URI wrapper is afected by allow_url_fopen -Status: Verified +Status: Closed Type: Documentation Problem Package: Streams related PHP Version: Irrelevant Assigned To: cmb Block user comment: N Private report: N New Comment: 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 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 (#18116) next »