Bug #78845 [Opn]: Serious bug with latest PHP 7.2.24 bug

From: Date: Wed, 20 Nov 2019 22:45:29 +0000
Subject: Bug #78845 [Opn]: Serious bug with latest PHP 7.2.24 bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223821@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78845&edit=1 ID: 78845 Updated by: cmb@php.net Reported by: gilperon at gmail dot com Summary: Serious bug with latest PHP 7.2.24 bug Status: Open Type: Bug Package: *General Issues Operating System: Centos 7 PHP Version: 7.2.24 Block user comment: N Private report: N New Comment: This might be related to bug #78824. Previous Comments: ------------------------------------------------------------------------ [2019-11-20 22:36:29] gilperon at gmail dot com Description: ------------ Hi, I have found a very serious and easy to reproduce bug happening with CURL on latest PHP 7.2.X (which is 7.2.24). Just run the code below on your server running PHP+APACHE+MARIADB: <?php $curl = curl_init(); $opts = array(); $opts[CURLOPT_URL] = "https://www.sitepor500.com.br"; curl_setopt_array($curl,$opts); echo curl_exec($curl); ?> It will work just fine, I mean, you will see the contents of the page on CURLOPT_URL. Now JUST ADD one single line of code to it and the bug will happen: <?php $conn = mysqli_connect("localhost","root","your_password"); $curl = curl_init(); $opts = array(); $opts[CURLOPT_URL] = "https://www.sitepor500.com.br"; curl_setopt_array($curl,$opts); echo curl_exec($curl); ?> Incredibly, just adding a connection to a local database will make CURL fetch the content of the URL specified at CURLOPT_URL as "" (empty string). This happens with any URL. Test script: --------------- <?php $conn = mysqli_connect("localhost","root","your_password"); $curl = curl_init(); $opts = array(); $opts[CURLOPT_URL] = "https://www.sitepor500.com.br"; curl_setopt_array($curl,$opts); echo curl_exec($curl); ?> Expected result: ---------------- You should see the URL content Actual result: -------------- Nothing is shown ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78845&edit=1

« previous php.bugs (#223821) next »