Skip to content

Commit 8ed150c

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/develop' into MAGETWO-41913-content-headers
2 parents 61eb3d9 + 12955b1 commit 8ed150c

File tree

964 files changed

+28589
-13020
lines changed

Some content is hidden

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

964 files changed

+28589
-13020
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ atlassian*
4747
/var/*
4848
!/var/.htaccess
4949
/vendor
50+
!/vendor/.htaccess

.htaccess

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,83 @@
171171
</IfModule>
172172

173173
###########################################
174-
## Deny access to release notes to prevent disclosure of the installed Magento version
174+
## Deny access to root files to hide sensitive application information
175+
RedirectMatch 404 /\.git
175176

176-
<Files RELEASE_NOTES.txt>
177-
Order allow,deny
178-
Deny from all
177+
<Files composer.json>
178+
order allow,deny
179+
deny from all
179180
</Files>
180-
############################################
181+
<Files composer.lock>
182+
order allow,deny
183+
deny from all
184+
</Files>
185+
<Files .gitignore>
186+
order allow,deny
187+
deny from all
188+
</Files>
189+
<Files .htaccess>
190+
order allow,deny
191+
deny from all
192+
</Files>
193+
<Files .htaccess.sample>
194+
order allow,deny
195+
deny from all
196+
</Files>
197+
<Files .php_cs>
198+
order allow,deny
199+
deny from all
200+
</Files>
201+
<Files .travis.yml>
202+
order allow,deny
203+
deny from all
204+
</Files>
205+
<Files CHANGELOG.md>
206+
order allow,deny
207+
deny from all
208+
</Files>
209+
<Files CONTRIBUTING.md>
210+
order allow,deny
211+
deny from all
212+
</Files>
213+
<Files CONTRIBUTOR_LICENSE_AGREEMENT.html>
214+
order allow,deny
215+
deny from all
216+
</Files>
217+
<Files COPYING.txt>
218+
order allow,deny
219+
deny from all
220+
</Files>
221+
<Files Gruntfile.js>
222+
order allow,deny
223+
deny from all
224+
</Files>
225+
<Files LICENSE.txt>
226+
order allow,deny
227+
deny from all
228+
</Files>
229+
<Files LICENSE_AFL.txt>
230+
order allow,deny
231+
deny from all
232+
</Files>
233+
<Files nginx.conf.sample>
234+
order allow,deny
235+
deny from all
236+
</Files>
237+
<Files package.json>
238+
order allow,deny
239+
deny from all
240+
</Files>
241+
<Files php.ini.sample>
242+
order allow,deny
243+
deny from all
244+
</Files>
245+
<Files README.md>
246+
order allow,deny
247+
deny from all
248+
</Files>
249+
250+
################################
181251
## If running in cluster environment, uncomment this
182252
## http://developer.yahoo.com/performance/rules.html#etags
183253

.htaccess.sample

Lines changed: 79 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
############################################
3737
## adjust memory limit
3838

39-
php_value memory_limit 256M
39+
php_value memory_limit 768M
4040
php_value max_execution_time 18000
4141

4242
############################################
@@ -65,13 +65,6 @@
6565
SecFilterScanPOST Off
6666
</IfModule>
6767

68-
<IfModule mod_headers.c>
69-
############################################
70-
## prevent clickjacking
71-
72-
Header set X-Frame-Options SAMEORIGIN
73-
</IfModule>
74-
7568
<IfModule mod_deflate.c>
7669

7770
############################################
@@ -136,9 +129,11 @@
136129
RewriteRule .* - [L,R=405]
137130

138131
############################################
139-
## always send 404 on missing files in these folders
132+
## redirect for mobile user agents
140133

141-
RewriteCond %{REQUEST_URI} !^/pub/(media|js)/
134+
#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
135+
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
136+
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
142137

143138
############################################
144139
## never rewrite for existing files, directories and links
@@ -175,16 +170,84 @@
175170
</IfModule>
176171

177172
###########################################
178-
## Deny access to release notes to prevent disclosure of the installed Magento version
173+
## Deny access to root files to hide sensitive application information
174+
RedirectMatch 404 /\.git
179175

180-
<Files RELEASE_NOTES.txt>
181-
Order allow,deny
182-
Deny from all
176+
<Files composer.json>
177+
order allow,deny
178+
deny from all
179+
</Files>
180+
<Files composer.lock>
181+
order allow,deny
182+
deny from all
183+
</Files>
184+
<Files .gitignore>
185+
order allow,deny
186+
deny from all
187+
</Files>
188+
<Files .htaccess>
189+
order allow,deny
190+
deny from all
191+
</Files>
192+
<Files .htaccess.sample>
193+
order allow,deny
194+
deny from all
195+
</Files>
196+
<Files .php_cs>
197+
order allow,deny
198+
deny from all
199+
</Files>
200+
<Files .travis.yml>
201+
order allow,deny
202+
deny from all
203+
</Files>
204+
<Files CHANGELOG.md>
205+
order allow,deny
206+
deny from all
207+
</Files>
208+
<Files CONTRIBUTING.md>
209+
order allow,deny
210+
deny from all
211+
</Files>
212+
<Files CONTRIBUTOR_LICENSE_AGREEMENT.html>
213+
order allow,deny
214+
deny from all
215+
</Files>
216+
<Files COPYING.txt>
217+
order allow,deny
218+
deny from all
219+
</Files>
220+
<Files Gruntfile.js>
221+
order allow,deny
222+
deny from all
223+
</Files>
224+
<Files LICENSE.txt>
225+
order allow,deny
226+
deny from all
227+
</Files>
228+
<Files LICENSE_AFL.txt>
229+
order allow,deny
230+
deny from all
231+
</Files>
232+
<Files nginx.conf.sample>
233+
order allow,deny
234+
deny from all
235+
</Files>
236+
<Files package.json>
237+
order allow,deny
238+
deny from all
239+
</Files>
240+
<Files php.ini.sample>
241+
order allow,deny
242+
deny from all
243+
</Files>
244+
<Files README.md>
245+
order allow,deny
246+
deny from all
183247
</Files>
184248

185-
############################################
249+
################################
186250
## If running in cluster environment, uncomment this
187251
## http://developer.yahoo.com/performance/rules.html#etags
188252

189253
#FileETag none
190-

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,13 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
4747
*/
4848
protected $_passTierPrice = 0;
4949

50-
/**
51-
* @var int
52-
*/
53-
protected $_passGroupPrice = 0;
54-
5550
/**
5651
* List of items websites
5752
*
5853
* @var array
5954
*/
6055
protected $_priceWebsite = [
6156
ImportAdvancedPricing::COL_TIER_PRICE_WEBSITE,
62-
ImportAdvancedPricing::COL_GROUP_PRICE_WEBSITE,
6357
];
6458

6559
/**
@@ -69,7 +63,6 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
6963
*/
7064
protected $_priceCustomerGroup = [
7165
ImportAdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP,
72-
ImportAdvancedPricing::COL_GROUP_PRICE_CUSTOMER_GROUP,
7366
];
7467

7568
/**
@@ -79,9 +72,6 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
7972
*/
8073
protected $templateExportData = [
8174
ImportAdvancedPricing::COL_SKU => '',
82-
ImportAdvancedPricing::COL_GROUP_PRICE_WEBSITE => '',
83-
ImportAdvancedPricing::COL_GROUP_PRICE_CUSTOMER_GROUP => '',
84-
ImportAdvancedPricing::COL_GROUP_PRICE => '',
8575
ImportAdvancedPricing::COL_TIER_PRICE_WEBSITE => '',
8676
ImportAdvancedPricing::COL_TIER_PRICE_CUSTOMER_GROUP => '',
8777
ImportAdvancedPricing::COL_TIER_PRICE_QTY => '',
@@ -246,14 +236,6 @@ public function filterAttributeCollection(\Magento\Eav\Model\Resource\Entity\Att
246236
) {
247237
$this->_passTierPrice = 1;
248238
}
249-
if ($attribute->getAttributeCode() == ImportAdvancedPricing::COL_GROUP_PRICE
250-
&& in_array(
251-
$attribute->getId(),
252-
$this->_parameters[\Magento\ImportExport\Model\Export::FILTER_ELEMENT_SKIP]
253-
)
254-
) {
255-
$this->_passGroupPrice = 1;
256-
}
257239
}
258240
$collection->removeItemByKey($attribute->getId());
259241
}
@@ -277,16 +259,10 @@ protected function getExportData()
277259
$rawData = $this->collectRawData();
278260
$productIds = array_keys($rawData);
279261
if (isset($productIds)) {
280-
if (!$this->_passGroupPrice) {
281-
$exportData = array_merge(
282-
$exportData,
283-
$this->getTierAndGroupPrices($productIds, ImportAdvancedPricing::TABLE_GROUPED_PRICE)
284-
);
285-
}
286262
if (!$this->_passTierPrice) {
287263
$exportData = array_merge(
288264
$exportData,
289-
$this->getTierAndGroupPrices($productIds, ImportAdvancedPricing::TABLE_TIER_PRICE)
265+
$this->getTierPrices($productIds, ImportAdvancedPricing::TABLE_TIER_PRICE)
290266
);
291267
}
292268
}
@@ -347,22 +323,12 @@ protected function correctExportData($exportData)
347323
* @SuppressWarnings(PHPMD.NPathComplexity)
348324
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
349325
*/
350-
protected function getTierAndGroupPrices(array $listSku, $table)
326+
protected function getTierPrices(array $listSku, $table)
351327
{
352328
if (isset($this->_parameters[\Magento\ImportExport\Model\Export::FILTER_ELEMENT_GROUP])) {
353329
$exportFilter = $this->_parameters[\Magento\ImportExport\Model\Export::FILTER_ELEMENT_GROUP];
354330
}
355-
if ($table == ImportAdvancedPricing::TABLE_GROUPED_PRICE) {
356-
$selectFields = [
357-
ImportAdvancedPricing::COL_SKU => 'cpe.sku',
358-
ImportAdvancedPricing::COL_GROUP_PRICE_WEBSITE => 'ap.website_id',
359-
ImportAdvancedPricing::COL_GROUP_PRICE_CUSTOMER_GROUP => 'ap.customer_group_id',
360-
ImportAdvancedPricing::COL_GROUP_PRICE => 'ap.value'
361-
];
362-
if (isset($exportFilter) && !empty($exportFilter)) {
363-
$price = $exportFilter['group_price'];
364-
}
365-
} elseif ($table == ImportAdvancedPricing::TABLE_TIER_PRICE) {
331+
if ($table == ImportAdvancedPricing::TABLE_TIER_PRICE) {
366332
$selectFields = [
367333
ImportAdvancedPricing::COL_SKU => 'cpe.sku',
368334
ImportAdvancedPricing::COL_TIER_PRICE_WEBSITE => 'ap.website_id',

0 commit comments

Comments
 (0)