Skip to content

Commit 5dc38df

Browse files
authored
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #12961: [Backport to 2.3-develop] Fixed double space typo (by @dverkade) - #12872: Fix import from external jpeg images (by @PieterCappelle) Fixed GitHub Issues: - #5306: Images imported via URL have crazy file paths (reported by @hgpit) has been fixed in #12872 by @PieterCappelle in 2.3-develop branch Related commits: 1. 8cdf043 2. 53292d3 - #12455: Import uploader does not check Content-Disposition header (reported by @EliasZ) has been fixed in #12872 by @PieterCappelle in 2.3-develop branch Related commits: 1. 8cdf043 2. 53292d3 - #12533: Unable to import external jpeg images from a CDN with dynamic URLs. (reported by @dromoded) has been fixed in #12872 by @PieterCappelle in 2.3-develop branch Related commits: 1. 8cdf043 2. 53292d3
2 parents ccf68bb + 6ad1d01 commit 5dc38df

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Uploader.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ public function move($fileName, $renameFileOff = false)
161161
$read = $this->_readFactory->create($url, DriverPool::HTTPS);
162162
}
163163

164+
//only use filename (for URI with query parameters)
165+
$parsedUrlPath = parse_url($url, PHP_URL_PATH);
166+
if ($parsedUrlPath) {
167+
$urlPathValues = explode('/', $parsedUrlPath);
168+
if (!empty($urlPathValues)) {
169+
$fileName = end($urlPathValues);
170+
}
171+
}
172+
164173
$fileName = preg_replace('/[^a-z0-9\._-]+/i', '', $fileName);
165174
$this->_directory->writeFile(
166175
$this->_directory->getRelativePath($this->getTmpDir() . '/' . $fileName),

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,32 @@ public function moveFileUrlDataProvider()
217217
[
218218
'$fileUrl' => 'http://test_uploader_file',
219219
'$expectedHost' => 'test_uploader_file',
220-
'$expectedFileName' => 'httptest_uploader_file',
220+
'$expectedFileName' => 'test_uploader_file',
221221
],
222222
[
223223
'$fileUrl' => 'https://!:^&`;file',
224224
'$expectedHost' => '!:^&`;file',
225-
'$expectedFileName' => 'httpsfile',
225+
'$expectedFileName' => 'file',
226+
],
227+
[
228+
'$fileUrl' => 'https://www.google.com/image.jpg',
229+
'$expectedHost' => 'www.google.com/image.jpg',
230+
'$expectedFileName' => 'image.jpg',
231+
],
232+
[
233+
'$fileUrl' => 'https://www.google.com/image.jpg?param=1',
234+
'$expectedHost' => 'www.google.com/image.jpg?param=1',
235+
'$expectedFileName' => 'image.jpg',
236+
],
237+
[
238+
'$fileUrl' => 'https://www.google.com/image.jpg?param=1&param=2',
239+
'$expectedHost' => 'www.google.com/image.jpg?param=1&param=2',
240+
'$expectedFileName' => 'image.jpg',
241+
],
242+
[
243+
'$fileUrl' => 'http://www.google.com/image.jpg?param=1&param=2',
244+
'$expectedHost' => 'www.google.com/image.jpg?param=1&param=2',
245+
'$expectedFileName' => 'image.jpg',
226246
],
227247
];
228248
}

app/code/Magento/Paypal/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ expires,expires
367367
here,here
368368
" to learn more."," to learn more."
369369
"Important: ","Important: "
370-
"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website."
370+
"To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.","To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website."
371371
"Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below"
372372
"To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website.","To use PayPal Payflow Link, you must configure your PayPal Payflow Link account on the PayPal website."
373373
"Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your PayPal Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below"

app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/advanced.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="payflow-settings-notice">
1313
<p>
1414
<strong class="important-label"><?= $block->escapeHtml(__('Important: ')) ?></strong>
15-
<?= $block->escapeHtml(__('To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.')) ?>
15+
<?= $block->escapeHtml(__('To use PayPal Payments Advanced, you must configure your PayPal Payments Advanced account on the PayPal website.')) ?>
1616
<?= $block->escapeHtml(__('Once you log into your PayPal Advanced account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below')) ?>
1717
</p>
1818
<ul class="options-list">

0 commit comments

Comments
 (0)