PHP :: Bug #76684 :: Curl BC break with CURLOPT_URL with domain relative url |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76684 Curl BC break with CURLOPT_URL with domain relative url
Submitted: 2018-07-30 12:14 UTC Modified: 2018-07-30 13:09 UTC
From: maggus dot staab+php at googlemail dot com Assigned:
Status: Open Package: cURL related
PHP Version: 7.2.8 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-07-30 12:14 UTC] maggus dot staab+php at googlemail dot com
when using domain relative urls with curl, this worked on php5 and also on php7.0

we are in the process of testing our software with php7.2 and see that we get a error in this case "<url> malformed".

I agree using the CURLOPT_URL option without absolute urls is not ideal, but since it worked in the past I would at least not expect a BC break with this behaviour in the php7.* series

Test script:
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, '/mytest');
        $error = '';
        if (curl_errno($ch) != 0) {
            $error = curl_error($ch);



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-30 13:09 UTC]
# php -v
PHP 5.6.15 (cli) (built: Oct 29 2015 12:40:36)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
# php 76684.php
string(15) "<url> malformed"
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Aug 16 12:01:24 2018 UTC