Skip to content

Commit a7ed518

Browse files
committed
Fixed test CurlTest::testUserAgent where PHP_VERSION contains regex special chars (e.g. 5.6.9-0+deb8u1)
1 parent 85742bc commit a7ed518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/PHPCurlClass/PHPCurlClassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testBuildPostDataArgSeparator()
8282

8383
public function testUserAgent()
8484
{
85-
$php_version = 'PHP\/' . PHP_VERSION;
85+
$php_version = preg_replace('/([\.\+\?\*\(\)\[\]\^\$\/])/', '\\\\\1', 'PHP/' . PHP_VERSION);
8686
$curl_version = curl_version();
8787
$curl_version = 'curl\/' . $curl_version['version'];
8888

0 commit comments

Comments
 (0)