We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The value of the Content-Length: header is checked in a preg_match in https://github.com/sonassi/magento-download-archive/blob/master/src/Download.php#L158 to verify a given file's size, but the header returned from curl is content-length: instead, so the value of $contentLength is undefined.
Content-Length:
preg_match
content-length:
$contentLength
If we add an echo $data; below https://github.com/sonassi/magento-download-archive/blob/master/src/Download.php#L155 to test, the output when running the phar with these options:
echo $data;
[0]: Other [0]: magento-sample-data-1.9.1.0.zip
is:
Downloading magento-sample-data-1.9.1.0.zip -- HTTP/2 200 date: Fri, 04 Dec 2020 15:48:01 GMT content-type: application/zip content-length: 440832557 server: nginx last-modified: Wed, 18 Dec 2019 16:58:04 GMT set-cookie: PHPSESSID=e6446bca395b5ae940ca4e71c1aff82a; expires=Fri, 04-Dec-2020 16:03:01 GMT; Max-Age=900; path=/; domain=www.magentocommerce.com; secure; HttpOnly cache-control: must-revalidate, post-check=0, pre-check=0 expires: Thu, 01 Jan 1970 00:00:00 GMT content-disposition: attachment; filename=magento-sample-data-1.9.1.0-2015-02-11-07-23-24.zip etag: "5dfa5a9c-1a46922d" strict-transport-security: max-age=15984000 x-frame-options: SAMEORIGIN accept-ranges: bytes PHP Notice: Undefined variable: contentLength in phar:///usr/src/magento/magento-download-archive/bin/mda.phar/Download.php on line 165 Downloading from https://MAG003125809:[email protected]/products/downloads/file/magento-sample-data-1.9.1.0.zip Does the remote file exist? File size is 0, cannot download
I think we should therefore make the preg_match check in https://github.com/sonassi/magento-download-archive/blob/master/src/Download.php#L158 case insensitive, by adding i:
i
if (preg_match('/Content-Length: (\d+)/i', $data, $matches))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The value of the
Content-Length:
header is checked in apreg_match
in https://github.com/sonassi/magento-download-archive/blob/master/src/Download.php#L158 to verify a given file's size, but the header returned from curl iscontent-length:
instead, so the value of$contentLength
is undefined.If we add an
echo $data;
below https://github.com/sonassi/magento-download-archive/blob/master/src/Download.php#L155 to test, the output when running the phar with these options:is:
I think we should therefore make the
preg_match
check in https://github.com/sonassi/magento-download-archive/blob/master/src/Download.php#L158 case insensitive, by addingi
:The text was updated successfully, but these errors were encountered: