{"action":"opened","issue":{"url":"https://api.github.com/repos/piwik/piwik/issues/7083","labels_url":"https://api.github.com/repos/piwik/piwik/issues/7083/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik/issues/7083/comments","events_url":"https://api.github.com/repos/piwik/piwik/issues/7083/events","html_url":"https://github.com/piwik/piwik/issues/7083","id":55644290,"number":7083,"title":"Bad transport method used in certain restricted environments.","user":{"login":"Zmetta","id":2156702,"avatar_url":"https://avatars.githubusercontent.com/u/2156702?v=3","gravatar_id":"","url":"https://api.github.com/users/Zmetta","html_url":"https://github.com/Zmetta","followers_url":"https://api.github.com/users/Zmetta/followers","following_url":"https://api.github.com/users/Zmetta/following{/other_user}","gists_url":"https://api.github.com/users/Zmetta/gists{/gist_id}","starred_url":"https://api.github.com/users/Zmetta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zmetta/subscriptions","organizations_url":"https://api.github.com/users/Zmetta/orgs","repos_url":"https://api.github.com/users/Zmetta/repos","events_url":"https://api.github.com/users/Zmetta/events{/privacy}","received_events_url":"https://api.github.com/users/Zmetta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-27T17:00:12Z","updated_at":"2015-01-27T17:00:12Z","closed_at":null,"body":"Automatic updates was failing with the following error:\r\n\r\n > Incompatible archive: PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature\r\n\r\nThe End of Central Dir Record couldn't be found for the latest.zip file because the file, although it was being created, was always empty. The problem turned out to be incomplete logic in /piwik/core/Http.php function isCurlEnabled() misidentifying the transport method. \r\n\r\n>48  protected static function isCurlEnabled()\r\n>49  {\r\n>50      return function_exists('curl_init');\r\n>51  }\r\n\r\nBoth curl_init and curl_exec are required to complete a cURL request, but Piwik only checks for curl_init when selecting the transfer method to use. In some hosting environments, where curl_exec has been disabled, this will cause Piwik to incorrectly pass cURL as the transport method and show cURL as the Open URL option in the System Check. \r\n\r\nDuring the automatic update, Piwik attempts to use cURL to fetch latest.zip, touches the file, but is unable to curl_exec the data causing the above error. \r\n\r\nThis simple patch should fix the issue for environments with curl_exec disabled and cause sockets to be correctly passed as the transport method:\r\n\r\n>protected static function isCurlEnabled()\r\n>{\r\n>    return (function_exists('curl_init') && function_exists('curl_exec'));\r\n>}\r\n"}}