Skip to content

Commit f7b3c52

Browse files
committed
Merge tag 'v19.4.9' into 20.0
2 parents 090ea91 + cbeebfa commit f7b3c52

File tree

353 files changed

+381
-988
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+381
-988
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,15 @@
910910
"contributions": [
911911
"code"
912912
]
913+
},
914+
{
915+
"login": "boesbo",
916+
"name": "Francesco Boes",
917+
"avatar_url": "https://avatars1.githubusercontent.com/u/12744378?v=4",
918+
"profile": "https://github.com/boesbo",
919+
"contributions": [
920+
"code"
921+
]
913922
}
914923
],
915924
"contributorsPerLine": 7

.github/changelog/version_19.txt

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11

22

3-
## v19.4.9 - unreleased
3+
## v19.4.10 - unreleased
4+
5+
## v19.4.9 - 2020-12-29
6+
7+
increase composer.json php version range to include 8.0
8+
#1349 Fixed Zend Lib Deprecated Notice PHP8
9+
#1213 Fix strpos with non-string needle
10+
add UnitTests to Github Actions
11+
#1348 Fixed Zend Lib Tool Deprecated Notice
12+
#1347 Fixed Zend Lib Amf Deprecated Notice
13+
#1340 Fixed Zend Lib Barcode Deprecated
14+
#1346 Fixed Zend Lib Validate Deprecated Notice
15+
#1256 Fix libxml_disable_entity_loader for PHP 8
16+
#1251 Disable class unserialization where it is not needed.
17+
#1350 Trim values from XML so auto-formatting our XML does not break the autoloader.
18+
#1345 Fixed Zend Lib Wildfire Deprecated Notice
19+
#1344 Fixed Zend Lib View Deprecated Notice
20+
#1343 Fixed Zend Lib JSON Deprecated Notice
21+
#1342 Fixed Zend Lib Filter Deprecated Notice
22+
#1341 fix "Cannot unset $this" error
23+
#1261 getAttributeRawValue() move operations with store to if statement
24+
#1274 Removed unused fetchAll in addRatingInfo()
25+
#1278 Handled the case where the coupon no longer exists
26+
#1328 Fix phpDoc for set/getStepData in Checkout
27+
#1323 Improve PHPDoc
28+
#1319 Fix for currency symbol not saved with fatal PHP error #1318
29+
#1297 Update SECURITY.md
30+
allow version 4 of hackathon composer installer
31+
#1292 Support the logging of Throwables
32+
#1285 Mage core model url - method call is provided 2 parameters, but the method signature uses 1 parameters
33+
#1161 cleanup: Remove some files left in previous PRs
34+
#1207 bugfix: don't cast min_sale_qty to int as it can be a decimal
35+
#1279 Remove php short open tag
436

537

638
## v19.4.8 - 2020-10-20

.github/changelog/version_20.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

22

33

4-
## v20.0.5 - unreleased
4+
## v20.0.6 - unreleased
5+
6+
## v20.0.5 - 2020-12-29
7+
8+
merged changes from v19.4.9
59

610

711
## v20.0.4 - 2020-10-20

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: composer validate
2323

2424
- name: Install dependencies
25-
run: composer install --prefer-dist --no-progress --no-suggest
25+
run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
2626

2727
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
2828
# Docs: https://getcomposer.org/doc/articles/scripts.md

.github/workflows/unit-tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: OpenMage LTS - Unit Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
unit-tests:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
repository: OpenMage/Testfield
16+
path: ./
17+
18+
- name: php & Composer version
19+
run: php --version && composer --version
20+
21+
- name: Install dependencies
22+
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
23+
24+
- name: Checkout OpenMage repo
25+
uses: actions/checkout@v2
26+
with:
27+
path: openmage
28+
29+
- name: Install OpenMage dependencies
30+
working-directory: ./openmage
31+
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
32+
33+
- name: run phpUnit
34+
run: bash ./run_unit_tests.sh
35+
36+
- name: Publish Unit Test Results
37+
uses: EnricoMi/[email protected]
38+
if: always()
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
files: output/*.xml

README.md

Lines changed: 104 additions & 104 deletions
Large diffs are not rendered by default.

SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ We will keep the details of your security vulnerability report private and only
88

99
| OpenMage LTS Tag | Magento Version | Branch | Supported |
1010
| -------------------- | ----------------- | ---------------- | ------------------ |
11-
| ~19.4.3 | 1.9.4.5 | 1.9.4.x | :white_check_mark: |
11+
| ~20.0.4 | 1.9.4.5 | 20.0 | :white_check_mark: |
12+
| ~19.4.8 | 1.9.4.5 | 1.9.4.x | :white_check_mark: |
1213
| - | <= 1.9.4.4 | multiple | :x: |
1314

1415
## Reporting a Vulnerability

app/Mage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public static function getOpenMageVersionInfo()
215215
return array(
216216
'major' => '20',
217217
'minor' => '0',
218-
'patch' => '4',
218+
'patch' => '5',
219219
'stability' => '', // beta,alpha,rc
220220
'number' => '', // 1,2,3,0.3.7,x.7.z.92 @see https://semver.org/#spec-item-9
221221
);
@@ -905,9 +905,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
905905
/**
906906
* Write exception to log
907907
*
908-
* @param Exception $e
908+
* @param Throwable $e
909909
*/
910-
public static function logException(Exception $e)
910+
public static function logException(Throwable $e)
911911
{
912912
if (!self::getConfig()) {
913913
return;
@@ -941,9 +941,9 @@ public static function getIsDeveloperMode()
941941
/**
942942
* Display exception
943943
*
944-
* @param Exception $e
944+
* @param Throwable $e
945945
*/
946-
public static function printException(Exception $e, $extra = '')
946+
public static function printException(Throwable $e, $extra = '')
947947
{
948948
if (self::$_isDeveloperMode) {
949949
print '<pre>';

app/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
* @link https://bugs.php.net/bug.php?id=62577
3030
* @link https://bugs.php.net/bug.php?id=64938
3131
*/
32-
if (function_exists('libxml_disable_entity_loader')) {
32+
if ((LIBXML_VERSION < 20900) && function_exists('libxml_disable_entity_loader')) {
3333
libxml_disable_entity_loader(false);
3434
}

app/code/core/Mage/Admin/Model/Resource/Acl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr)
133133
$assert = null;
134134
if (0 != $rule['assert_id']) {
135135
$assertClass = Mage::getSingleton('admin/config')->getAclAssert($rule['assert_type'])->getClassName();
136-
$assert = new $assertClass(unserialize($rule['assert_data']));
136+
$assert = new $assertClass(unserialize($rule['assert_data'], ['allowed_classes' => false]));
137137
}
138138
try {
139139
if ($rule['permission'] == 'allow') {

app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function getPackages()
201201
{
202202
$packages = $this->getShipment()->getPackages();
203203
if ($packages) {
204-
$packages = unserialize($packages);
204+
$packages = unserialize($packages, ['allowed_classes' => false]);
205205
} else {
206206
$packages = array();
207207
}

app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ public function moveQuoteItem($item, $moveTo, $qty)
580580
$info = $item->getOptionByCode('info_buyRequest');
581581
if ($info) {
582582
$info = new Varien_Object(
583-
unserialize($info->getValue())
583+
unserialize($info->getValue(), ['allowed_classes' => false])
584584
);
585585
$info->setQty($qty);
586586
$info->setOptions($this->_prepareOptionsForRequest($item));
@@ -1511,7 +1511,7 @@ protected function _prepareQuoteItems()
15111511
}
15121512
$addOptions = $item->getOptionByCode('additional_options');
15131513
if ($addOptions) {
1514-
$options['additional_options'] = unserialize($addOptions->getValue());
1514+
$options['additional_options'] = unserialize($addOptions->getValue(), ['allowed_classes' => false]);
15151515
}
15161516
$item->setProductOrderOptions($options);
15171517
}

app/code/core/Mage/Api/Model/Resource/Acl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function loadRules(Mage_Api_Model_Acl $acl, array $rulesArr)
123123
$assert = null;
124124
if (0!=$rule['assert_id']) {
125125
$assertClass = Mage::getSingleton('api/config')->getAclAssert($rule['assert_type'])->getClassName();
126-
$assert = new $assertClass(unserialize($rule['assert_data']));
126+
$assert = new $assertClass(unserialize($rule['assert_data'], ['allowed_classes' => false]));
127127
}
128128
try {
129129
if ($rule['api_permission'] == 'allow') {

app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function getSelectionAttributes($item)
167167
$options = $item->getOrderItem()->getProductOptions();
168168
}
169169
if (isset($options['bundle_selection_attributes'])) {
170-
return unserialize($options['bundle_selection_attributes']);
170+
return unserialize($options['bundle_selection_attributes'], ['allowed_classes' => false]);
171171
}
172172
return null;
173173
}

app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function getSelectionAttributes($item)
126126
$options = $item->getOrderItem()->getProductOptions();
127127
}
128128
if (isset($options['bundle_selection_attributes'])) {
129-
return unserialize($options['bundle_selection_attributes']);
129+
return unserialize($options['bundle_selection_attributes'], ['allowed_classes' => false]);
130130
}
131131
return null;
132132
}

app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function getSelectionAttributes($item)
131131
$options = $item->getOrderItem()->getProductOptions();
132132
}
133133
if (isset($options['bundle_selection_attributes'])) {
134-
return unserialize($options['bundle_selection_attributes']);
134+
return unserialize($options['bundle_selection_attributes'], ['allowed_classes' => false]);
135135
}
136136
return null;
137137
}

app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function getBundleOptions(Mage_Catalog_Model_Product_Configuration_Item_I
9191

9292
// get bundle options
9393
$optionsQuoteItemOption = $item->getOptionByCode('bundle_option_ids');
94-
$bundleOptionsIds = $optionsQuoteItemOption ? unserialize($optionsQuoteItemOption->getValue()) : array();
94+
$bundleOptionsIds = $optionsQuoteItemOption ? unserialize($optionsQuoteItemOption->getValue(), ['allowed_classes' => false]) : array();
9595
if ($bundleOptionsIds) {
9696
/**
9797
* @var Mage_Bundle_Model_Resource_Option_Collection
@@ -101,11 +101,11 @@ public function getBundleOptions(Mage_Catalog_Model_Product_Configuration_Item_I
101101
// get and add bundle selections collection
102102
$selectionsQuoteItemOption = $item->getOptionByCode('bundle_selection_ids');
103103

104-
$bundleSelectionIds = unserialize($selectionsQuoteItemOption->getValue());
104+
$bundleSelectionIds = unserialize($selectionsQuoteItemOption->getValue(), ['allowed_classes' => false]);
105105

106106
if (!empty($bundleSelectionIds)) {
107107
$selectionsCollection = $typeInstance->getSelectionsByIds(
108-
unserialize($selectionsQuoteItemOption->getValue()),
108+
unserialize($selectionsQuoteItemOption->getValue(), ['allowed_classes' => false]),
109109
$product
110110
);
111111

app/code/core/Mage/Bundle/Model/Product/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function getTotalBundleItemsPrice($product, $qty = null)
8888
if ($product->hasCustomOptions()) {
8989
$customOption = $product->getCustomOption('bundle_selection_ids');
9090
if ($customOption) {
91-
$selectionIds = unserialize($customOption->getValue());
91+
$selectionIds = unserialize($customOption->getValue(), ['allowed_classes' => false]);
9292
/** @var Mage_Bundle_Model_Resource_Selection_Collection $selections */
9393
$selections = $product->getTypeInstance(true)->getSelectionsByIds($selectionIds, $product);
9494
$selections->addTierPriceData();

app/code/core/Mage/Bundle/Model/Product/Type.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function getSku($product = null)
148148

149149
if ($this->getProduct($product)->hasCustomOptions()) {
150150
$customOption = $this->getProduct($product)->getCustomOption('bundle_selection_ids');
151-
$selectionIds = unserialize($customOption->getValue());
151+
$selectionIds = unserialize($customOption->getValue(), ['allowed_classes' => false]);
152152
if (!empty($selectionIds)) {
153153
$selections = $this->getSelectionsByIds($selectionIds, $product);
154154
foreach ($selections->getItems() as $selection) {
@@ -176,7 +176,7 @@ public function getWeight($product = null)
176176

177177
if ($this->getProduct($product)->hasCustomOptions()) {
178178
$customOption = $this->getProduct($product)->getCustomOption('bundle_selection_ids');
179-
$selectionIds = unserialize($customOption->getValue());
179+
$selectionIds = unserialize($customOption->getValue(), ['allowed_classes' => false]);
180180
$selections = $this->getSelectionsByIds($selectionIds, $product);
181181
foreach ($selections->getItems() as $selection) {
182182
$qtyOption = $this->getProduct($product)
@@ -202,7 +202,7 @@ public function isVirtual($product = null)
202202
{
203203
if ($this->getProduct($product)->hasCustomOptions()) {
204204
$customOption = $this->getProduct($product)->getCustomOption('bundle_selection_ids');
205-
$selectionIds = unserialize($customOption->getValue());
205+
$selectionIds = unserialize($customOption->getValue(), ['allowed_classes' => false]);
206206
$selections = $this->getSelectionsByIds($selectionIds, $product);
207207
$virtualCount = 0;
208208
foreach ($selections->getItems() as $selection) {
@@ -788,10 +788,10 @@ public function getOrderOptions($product = null)
788788

789789
if ($product->hasCustomOptions()) {
790790
$customOption = $product->getCustomOption('bundle_option_ids');
791-
$optionIds = unserialize($customOption->getValue());
791+
$optionIds = unserialize($customOption->getValue(), ['allowed_classes' => false]);
792792
$options = $this->getOptionsByIds($optionIds, $product);
793793
$customOption = $product->getCustomOption('bundle_selection_ids');
794-
$selectionIds = unserialize($customOption->getValue());
794+
$selectionIds = unserialize($customOption->getValue(), ['allowed_classes' => false]);
795795
$selections = $this->getSelectionsByIds($selectionIds, $product);
796796
foreach ($selections->getItems() as $selection) {
797797
if ($selection->isSalable()) {
@@ -934,9 +934,9 @@ public function checkProductBuyState($product = null)
934934
$productOptionIds = $this->getOptionsIds($product);
935935
$productSelections = $this->getSelectionsCollection($productOptionIds, $product);
936936
$selectionIds = $product->getCustomOption('bundle_selection_ids');
937-
$selectionIds = (array) unserialize($selectionIds->getValue());
937+
$selectionIds = (array) unserialize($selectionIds->getValue(), ['allowed_classes' => false]);
938938
$buyRequest = $product->getCustomOption('info_buyRequest');
939-
$buyRequest = new Varien_Object(unserialize($buyRequest->getValue()));
939+
$buyRequest = new Varien_Object(unserialize($buyRequest->getValue(), ['allowed_classes' => false]));
940940
$bundleOption = $buyRequest->getBundleOption();
941941

942942
if (empty($bundleOption) && empty($selectionIds)) {

app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function getSelectionAttributes($item)
196196
$options = $item->getOrderItem()->getProductOptions();
197197
}
198198
if (isset($options['bundle_selection_attributes'])) {
199-
return unserialize($options['bundle_selection_attributes']);
199+
return unserialize($options['bundle_selection_attributes'], ['allowed_classes' => false]);
200200
}
201201
return null;
202202
}

app/code/core/Mage/Catalog/Helper/Product/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getCustomOptions(Mage_Catalog_Model_Product_Configuration_Item_I
8585

8686
$addOptions = $item->getOptionByCode('additional_options');
8787
if ($addOptions) {
88-
$options = array_merge($options, unserialize($addOptions->getValue()));
88+
$options = array_merge($options, unserialize($addOptions->getValue(), ['allowed_classes' => false]));
8989
}
9090

9191
return $options;

app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getAllOptions()
4242
{
4343
$cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode();
4444
if (Mage::app()->useCache('config') && $cache = Mage::app()->loadCache($cacheKey)) {
45-
$options = unserialize($cache);
45+
$options = unserialize($cache, ['allowed_classes' => false]);
4646
} else {
4747
$collection = Mage::getModel('directory/country')->getResourceCollection();
4848
if (!Mage::app()->getStore()->isAdmin()) {

app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ public function getOrderOptions($product = null)
602602
{
603603
$optionArr = array();
604604
if ($info = $this->getProduct($product)->getCustomOption('info_buyRequest')) {
605-
$optionArr['info_buyRequest'] = unserialize($info->getValue());
605+
$optionArr['info_buyRequest'] = unserialize($info->getValue(), ['allowed_classes' => false]);
606606
}
607607

608608
if ($optionIds = $this->getProduct($product)->getCustomOption('option_ids')) {

app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ public function getSelectedAttributesInfo($product = null)
548548
$attributes = array();
549549
Varien_Profiler::start('CONFIGURABLE:'.__METHOD__);
550550
if ($attributesOption = $this->getProduct($product)->getCustomOption('attributes')) {
551-
$data = unserialize($attributesOption->getValue());
551+
$data = unserialize($attributesOption->getValue(), ['allowed_classes' => false]);
552552
$this->getUsedProductAttributeIds($product);
553553

554554
$usedAttributes = $this->getProduct($product)->getData($this->_usedAttributes);
@@ -681,7 +681,7 @@ public function checkProductBuyState($product = null)
681681
$product = $this->getProduct($product);
682682
$option = $product->getCustomOption('info_buyRequest');
683683
if ($option instanceof Mage_Sales_Model_Quote_Item_Option) {
684-
$buyRequest = new Varien_Object(unserialize($option->getValue()));
684+
$buyRequest = new Varien_Object(unserialize($option->getValue(), ['allowed_classes' => false]));
685685
$attributes = $buyRequest->getSuperAttribute();
686686
if (is_array($attributes)) {
687687
foreach ($attributes as $key => $val) {

app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getTotalConfigurableItemsPrice($product, $finalPrice)
7878

7979
$selectedAttributes = array();
8080
if ($product->getCustomOption('attributes')) {
81-
$selectedAttributes = unserialize($product->getCustomOption('attributes')->getValue());
81+
$selectedAttributes = unserialize($product->getCustomOption('attributes')->getValue(), ['allowed_classes' => false]);
8282
}
8383

8484
/** @var Mage_Catalog_Model_Product_Type_Configurable_Attribute $attribute */

0 commit comments

Comments
 (0)