Skip to content

Wrong use of cURL options #38

Open
@tm-webentwicklung

Description

@tm-webentwicklung

In \Model\AdminNotificationFeed.php you use this code in function parentGetFeedData():

$curl->setOptions( [ 'timeout' => 2, 'useragent' => $this->productMetadata->getName() . '/' . $this->productMetadata->getVersion() . ' (' . $this->productMetadata->getEdition() . ')', 'referer' => $this->urlBuilder->getUrl('*/*/*') ] );

In my installation of Magento it throws an error in \vendor\magento\framework\HTTP\Adapter\Curl.php, Line 71, because the options "timeout", "useragent" and "referer" are strings and not ints. You should use the Predefined Constants for cURL instead:

$curl->setOptions( [ CURLOPT_TIMEOUT => 2, CURLOPT_USERAGENT => $this->productMetadata->getName() . '/' . $this->productMetadata->getVersion() . ' (' . $this->productMetadata->getEdition() . ')', CURLOPT_REFERER => $this->urlBuilder->getUrl('*/*/*') ] );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions