diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php
index 2132ace0449..31de8eb27c8 100644
--- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php
+++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php
@@ -164,41 +164,46 @@ public function getLinkData()
'sample_type' => $item->getSampleType(),
'sort_order' => $item->getSortOrder(),
];
- $file = Mage::helper('downloadable/file')->getFilePath(
- Mage_Downloadable_Model_Link::getBasePath(),
- $item->getLinkFile()
- );
-
- if ($item->getLinkFile() && !is_file($file)) {
- Mage::helper('core/file_storage_database')->saveFileToFilesystem($file);
- }
- if ($item->getLinkFile() && is_file($file)) {
- $name = '' . Mage::helper('downloadable/file')->getFileFromPathFile($item->getLinkFile()) . '';
- $tmpLinkItem['file_save'] = [
- [
- 'file' => $item->getLinkFile(),
- 'name' => $name,
- 'size' => filesize($file),
- 'status' => 'old'
- ]];
+ if ($item->getLinkFile()) {
+ $file = Mage::helper('downloadable/file')->getFilePath(
+ Mage_Downloadable_Model_Link::getBasePath(),
+ $item->getLinkFile()
+ );
+ if (!is_file($file)) {
+ Mage::helper('core/file_storage_database')->saveFileToFilesystem($file);
+ }
+ if (is_file($file)) {
+ $name = '' . Mage::helper('downloadable/file')->getFileFromPathFile($item->getLinkFile()) . '';
+ $tmpLinkItem['file_save'] = [
+ [
+ 'file' => $item->getLinkFile(),
+ 'name' => $name,
+ 'size' => filesize($file),
+ 'status' => 'old'
+ ]
+ ];
+ }
}
- $sampleFile = Mage::helper('downloadable/file')->getFilePath(
- Mage_Downloadable_Model_Link::getBaseSamplePath(),
- $item->getSampleFile()
- );
- if ($item->getSampleFile() && is_file($sampleFile)) {
- $tmpLinkItem['sample_file_save'] = [
- [
- 'file' => $item->getSampleFile(),
- 'name' => Mage::helper('downloadable/file')->getFileFromPathFile($item->getSampleFile()),
- 'size' => filesize($sampleFile),
- 'status' => 'old'
- ]];
+ if ($item->getSampleFile()) {
+ $sampleFile = Mage::helper('downloadable/file')->getFilePath(
+ Mage_Downloadable_Model_Link::getBaseSamplePath(),
+ $item->getSampleFile()
+ );
+ if (is_file($sampleFile)) {
+ $tmpLinkItem['sample_file_save'] = [
+ [
+ 'file' => $item->getSampleFile(),
+ 'name' => Mage::helper('downloadable/file')->getFileFromPathFile($item->getSampleFile()),
+ 'size' => filesize($sampleFile),
+ 'status' => 'old'
+ ]
+ ];
+ }
}
if ($item->getNumberOfDownloads() == '0') {
$tmpLinkItem['is_unlimited'] = ' checked="checked"';
diff --git a/composer.lock b/composer.lock
index af1b9fd0164..2b379b7b11d 100644
--- a/composer.lock
+++ b/composer.lock
@@ -772,16 +772,16 @@
},
{
"name": "phpseclib/phpseclib",
- "version": "3.0.19",
+ "version": "3.0.20",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
- "reference": "cc181005cf548bfd8a4896383bb825d859259f95"
+ "reference": "543a1da81111a0bfd6ae7bbc2865c5e89ed3fc67"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cc181005cf548bfd8a4896383bb825d859259f95",
- "reference": "cc181005cf548bfd8a4896383bb825d859259f95",
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/543a1da81111a0bfd6ae7bbc2865c5e89ed3fc67",
+ "reference": "543a1da81111a0bfd6ae7bbc2865c5e89ed3fc67",
"shasum": ""
},
"require": {
@@ -862,7 +862,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
- "source": "https://github.com/phpseclib/phpseclib/tree/3.0.19"
+ "source": "https://github.com/phpseclib/phpseclib/tree/3.0.20"
},
"funding": [
{
@@ -878,7 +878,7 @@
"type": "tidelift"
}
],
- "time": "2023-03-05T17:13:09+00:00"
+ "time": "2023-06-13T06:30:34+00:00"
},
{
"name": "psr/container",
@@ -2469,25 +2469,29 @@
},
{
"name": "doctrine/deprecations",
- "version": "v1.0.0",
+ "version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
- "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de"
+ "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de",
- "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de",
+ "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
+ "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
"shasum": ""
},
"require": {
- "php": "^7.1|^8.0"
+ "php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9",
- "phpunit/phpunit": "^7.5|^8.5|^9.5",
- "psr/log": "^1|^2|^3"
+ "phpstan/phpstan": "1.4.10 || 1.10.15",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+ "psalm/plugin-phpunit": "0.18.4",
+ "psr/log": "^1 || ^2 || ^3",
+ "vimeo/psalm": "4.30.0 || 5.12.0"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
@@ -2506,9 +2510,9 @@
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
- "source": "https://github.com/doctrine/deprecations/tree/v1.0.0"
+ "source": "https://github.com/doctrine/deprecations/tree/v1.1.1"
},
- "time": "2022-05-02T15:47:09+00:00"
+ "time": "2023-06-03T09:27:29+00:00"
},
{
"name": "doctrine/instantiator",
@@ -2660,16 +2664,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
- "version": "v3.17.0",
+ "version": "v3.18.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
- "reference": "3f0ed862f22386c55a767461ef5083bddceeed79"
+ "reference": "b123395c9fa3a70801f816f13606c0f3a7ada8df"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/3f0ed862f22386c55a767461ef5083bddceeed79",
- "reference": "3f0ed862f22386c55a767461ef5083bddceeed79",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b123395c9fa3a70801f816f13606c0f3a7ada8df",
+ "reference": "b123395c9fa3a70801f816f13606c0f3a7ada8df",
"shasum": ""
},
"require": {
@@ -2744,7 +2748,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
- "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.17.0"
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.18.0"
},
"funding": [
{
@@ -2752,20 +2756,20 @@
"type": "github"
}
],
- "time": "2023-05-22T19:59:32+00:00"
+ "time": "2023-06-18T22:25:45+00:00"
},
{
"name": "macopedia/phpstan-magento1",
- "version": "v1.0.5",
+ "version": "v1.0.7",
"source": {
"type": "git",
"url": "https://github.com/macopedia/phpstan-magento1.git",
- "reference": "69346472b19422b2aefeb928d6488b5d907e8b1d"
+ "reference": "348ab687063bdd78c571091a16b0865935798b18"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/macopedia/phpstan-magento1/zipball/69346472b19422b2aefeb928d6488b5d907e8b1d",
- "reference": "69346472b19422b2aefeb928d6488b5d907e8b1d",
+ "url": "https://api.github.com/repos/macopedia/phpstan-magento1/zipball/348ab687063bdd78c571091a16b0865935798b18",
+ "reference": "348ab687063bdd78c571091a16b0865935798b18",
"shasum": ""
},
"require": {
@@ -2789,9 +2793,9 @@
"description": "Extension for PHPStan to allow analysis of Magento 1 code.",
"support": {
"issues": "https://github.com/macopedia/phpstan-magento1/issues",
- "source": "https://github.com/macopedia/phpstan-magento1/tree/v1.0.5"
+ "source": "https://github.com/macopedia/phpstan-magento1/tree/v1.0.7"
},
- "time": "2022-12-30T08:43:52+00:00"
+ "time": "2023-06-13T14:11:06+00:00"
},
{
"name": "magento-ecg/coding-standard",
@@ -3368,16 +3372,16 @@
},
{
"name": "phpstan/phpstan",
- "version": "1.10.18",
+ "version": "1.10.19",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "52b6416c579663eebdd2f1d97df21971daf3b43f"
+ "reference": "af5a296ff02610c1bfb4ddfac9fd4a08657b9046"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/52b6416c579663eebdd2f1d97df21971daf3b43f",
- "reference": "52b6416c579663eebdd2f1d97df21971daf3b43f",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/af5a296ff02610c1bfb4ddfac9fd4a08657b9046",
+ "reference": "af5a296ff02610c1bfb4ddfac9fd4a08657b9046",
"shasum": ""
},
"require": {
@@ -3426,7 +3430,7 @@
"type": "tidelift"
}
],
- "time": "2023-06-07T22:00:43+00:00"
+ "time": "2023-06-14T15:26:58+00:00"
},
{
"name": "phpunit/php-code-coverage",
diff --git a/js/mage/adminhtml/input-counter.js b/js/mage/adminhtml/input-counter.js
index aa74e3ffabd..1a690684468 100644
--- a/js/mage/adminhtml/input-counter.js
+++ b/js/mage/adminhtml/input-counter.js
@@ -1,5 +1,4 @@
-// https://stackoverflow.com/a/44436408/5703627
-document.observe('dom:loaded', function() {
+window.addEventListener('DOMContentLoaded', function() {
Element.addMethods({
// setup once, memorize the counter element and maxLen
prepare_for_countdown: function(element) {