1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
Files
archived-php-src/ext/curl/tests/bug79741.phpt
Nikita Popov 6e1990dea6 Don't accept objects instead of arrays in curl
This properly addresses the issue from bug #79741. Silently
interpreting objects as mangled property tables is almost
always a bad idea.

Closes GH-5773.
2020-06-29 15:56:22 +02:00

21 lines
448 B
PHP

--TEST--
Bug #79741: curl_setopt CURLOPT_POSTFIELDS asserts on object with declared properties
--FILE--
<?php
class Test {
public $prop = "value";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, new Test);
?>
===DONE===
--EXPECTF--
Fatal error: Uncaught Error: Object of class Test could not be converted to string in %s:%d
Stack trace:
#0 %s(%d): curl_setopt(Object(CurlHandle), %d, Object(Test))
#1 {main}
thrown in %s on line %d