mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Fix test to use PHP_CURL_HTTP_REMOTE_SERVER
This commit is contained in:
parent
0f0ffd38c9
commit
e3557389bf
1 changed files with 4 additions and 3 deletions
|
@ -12,7 +12,7 @@ if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function checkForClosedFilePointer($curl_option, $description) {
|
function checkForClosedFilePointer($host, $curl_option, $description) {
|
||||||
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');
|
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
|
@ -28,7 +28,7 @@ function checkForClosedFilePointer($curl_option, $description) {
|
||||||
|
|
||||||
curl_setopt($ch, $curl_option, $fp);
|
curl_setopt($ch, $curl_option, $fp);
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_URL, 'localhost');
|
curl_setopt($ch, CURLOPT_URL, $host);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
|
||||||
fclose($fp); // <-- premature close of $fp caused a crash!
|
fclose($fp); // <-- premature close of $fp caused a crash!
|
||||||
|
@ -47,8 +47,9 @@ $options_to_check = array(
|
||||||
"CURLOPT_INFILE"
|
"CURLOPT_INFILE"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||||
foreach($options_to_check as $option) {
|
foreach($options_to_check as $option) {
|
||||||
checkForClosedFilePointer(constant($option), $option);
|
checkForClosedFilePointer($host, constant($option), $option);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue