Skip to content

Commit 777f782

Browse files
author
Kopylova,Olga(okopylova)
committed
Merge pull request #105 from magento-ogre/PR_Branch
[Ogres] Bug Fixes
2 parents e680fbb + 4145332 commit 777f782

File tree

20 files changed

+223
-169
lines changed

20 files changed

+223
-169
lines changed

app/code/Magento/Theme/Model/Theme/ThemeDependencyChecker.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public function checkChildTheme($themePaths)
115115
private function getParentChildThemeMap()
116116
{
117117
$map = [];
118+
$this->themeCollection->resetConstraints();
119+
$this->themeCollection->clear();
118120
/** @var \Magento\Theme\Model\Theme\Data $theme */
119121
foreach ($this->themeCollection as $theme) {
120122
if ($theme->getParentTheme()) {

lib/internal/Magento/Framework/App/Router/ActionList.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010

1111
class ActionList
1212
{
13+
/**
14+
* Not allowed string in route's action path to avoid disclosing admin url
15+
*/
16+
const NOT_ALLOWED_IN_NAMESPACE_PATH = 'adminhtml_';
17+
1318
/**
1419
* List of application actions
1520
*
1621
* @var array
1722
*/
1823
protected $actions;
1924

20-
/**
21-
* @var ModuleReader
22-
*/
23-
protected $moduleReader;
24-
2525
/**
2626
* @var array
2727
*/
@@ -52,9 +52,8 @@ public function __construct(
5252
$this->reservedWords = array_merge($reservedWords, $this->reservedWords);
5353
$this->actionInterface = $actionInterface;
5454
$data = $cache->load($cacheKey);
55-
$this->moduleReader = $moduleReader;
5655
if (!$data) {
57-
$this->actions = $this->moduleReader->getActionFiles();
56+
$this->actions = $moduleReader->getActionFiles();
5857
$cache->save(serialize($this->actions), $cacheKey);
5958
} else {
6059
$this->actions = unserialize($data);
@@ -75,20 +74,19 @@ public function get($module, $area, $namespace, $action)
7574
if ($area) {
7675
$area = '\\' . $area;
7776
}
77+
if (strpos($namespace, self::NOT_ALLOWED_IN_NAMESPACE_PATH) !== false) {
78+
return null;
79+
}
7880
if (in_array(strtolower($action), $this->reservedWords)) {
7981
$action .= 'action';
8082
}
81-
$fullPath = str_replace(
82-
'_',
83-
'\\',
84-
strtolower(
85-
$module . '\\controller' . $area . '\\' . $namespace . '\\' . $action
86-
)
83+
$fullPath = strtolower(
84+
str_replace('_', '\\', $module) . '\\controller' . $area
85+
. '\\' . str_replace('_', '\\', $namespace) . '\\' . $action
8786
);
8887
if (isset($this->actions[$fullPath])) {
8988
return is_subclass_of($this->actions[$fullPath], $this->actionInterface) ? $this->actions[$fullPath] : null;
9089
}
91-
9290
return null;
9391
}
9492
}

lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ public function getDataProvider()
142142
['magento\module\controller\area\namespace\catchaction' => $mockClassName],
143143
$actionClass
144144
],
145+
[
146+
'Magento_Module',
147+
'Area',
148+
'Namespace_A',
149+
'Index_edit',
150+
['magento\module\controller\area\namespace\a\index_edit' => $mockClassName],
151+
$actionClass
152+
],
145153
[
146154
'Magento_Module',
147155
'Area',
@@ -158,6 +166,14 @@ public function getDataProvider()
158166
[],
159167
null
160168
],
169+
[
170+
'Magento_Module',
171+
null,
172+
'adminhtml_product',
173+
'index',
174+
'magento\module\controller\adminhtml\product\index' => '$mockClassName',
175+
null
176+
],
161177
];
162178
}
163179
}

nginx.conf.sample

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ location /setup {
3939
location ~ ^/setup/(?!pub/). {
4040
deny all;
4141
}
42+
43+
location ~ ^/setup/pub/ {
44+
add_header X-Frame-Options "SAMEORIGIN";
45+
}
4246
}
4347

4448
location /update {
@@ -55,6 +59,10 @@ location /update {
5559
location ~ ^/update/(?!pub/). {
5660
deny all;
5761
}
62+
63+
location ~ ^/update/pub/ {
64+
add_header X-Frame-Options "SAMEORIGIN";
65+
}
5866
}
5967

6068
location / {
@@ -66,6 +74,7 @@ location /pub {
6674
deny all;
6775
}
6876
alias $MAGE_ROOT/pub;
77+
add_header X-Frame-Options "SAMEORIGIN";
6978
}
7079

7180
location /static/ {
@@ -74,6 +83,7 @@ location /static/ {
7483
}
7584
location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
7685
add_header Cache-Control "public";
86+
add_header X-Frame-Options "SAMEORIGIN";
7787
expires +1y;
7888

7989
if (!-f $request_filename) {
@@ -82,6 +92,7 @@ location /static/ {
8292
}
8393
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
8494
add_header Cache-Control "no-store";
95+
add_header X-Frame-Options "SAMEORIGIN";
8596
expires off;
8697

8798
if (!-f $request_filename) {
@@ -91,6 +102,7 @@ location /static/ {
91102
if (!-f $request_filename) {
92103
rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
93104
}
105+
add_header X-Frame-Options "SAMEORIGIN";
94106
}
95107

96108
location /media/ {
@@ -102,14 +114,17 @@ location /media/ {
102114

103115
location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
104116
add_header Cache-Control "public";
117+
add_header X-Frame-Options "SAMEORIGIN";
105118
expires +1y;
106119
try_files $uri $uri/ /get.php?$args;
107120
}
108121
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
109122
add_header Cache-Control "no-store";
123+
add_header X-Frame-Options "SAMEORIGIN";
110124
expires off;
111125
try_files $uri $uri/ /get.php?$args;
112126
}
127+
add_header X-Frame-Options "SAMEORIGIN";
113128
}
114129

115130
location /media/customer/ {

pub/.htaccess

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,9 @@
208208
order allow,deny
209209
deny from all
210210
</Files>
211+
212+
<IfModule mod_headers.c>
213+
############################################
214+
## prevent clickjacking
215+
Header set X-Frame-Options SAMEORIGIN
216+
</IfModule>

setup/config/states.installer.config.php renamed to setup/config/states.install.config.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
return [
1010
'navInstallerTitles' => [
11-
'installer' => 'Magento Installer',
11+
'install' => 'Magento Installer',
1212
],
1313
'navInstaller' => [
1414
[
@@ -24,39 +24,39 @@
2424
'main' => true,
2525
'nav' => false,
2626
'order' => -1,
27-
'type' => 'installer'
27+
'type' => 'install'
2828
],
2929
[
30-
'id' => 'root.landing-installer',
31-
'url' => 'landing-installer',
30+
'id' => 'root.landing-install',
31+
'url' => 'landing-install',
3232
'templateUrl' => "$base/landing-installer",
3333
'title' => 'Landing',
3434
'controller' => 'landingController',
3535
'main' => true,
3636
'default' => true,
3737
'order' => 0,
38-
'type' => 'installer'
38+
'type' => 'install'
3939
],
4040
[
41-
'id' => 'root.readiness-check-installer',
42-
'url' => 'readiness-check-installer',
41+
'id' => 'root.readiness-check-install',
42+
'url' => 'readiness-check-install',
4343
'templateUrl' => "{$base}/readiness-check-installer",
4444
'title' => "Readiness \n Check",
4545
'header' => 'Step 1: Readiness Check',
4646
'nav' => true,
4747
'order' => 1,
48-
'type' => 'installer'
48+
'type' => 'install'
4949
],
5050
[
51-
'id' => 'root.readiness-check-installer.progress',
52-
'url' => 'readiness-check-installer/progress',
51+
'id' => 'root.readiness-check-install.progress',
52+
'url' => 'readiness-check-install/progress',
5353
'templateUrl' => "{$base}/readiness-check-installer/progress",
5454
'title' => 'Readiness Check',
5555
'header' => 'Step 1: Readiness Check',
5656
'controller' => 'readinessCheckController',
5757
'nav' => false,
5858
'order' => 2,
59-
'type' => 'installer'
59+
'type' => 'install'
6060
],
6161
[
6262
'id' => 'root.add-database',
@@ -68,7 +68,7 @@
6868
'nav' => true,
6969
'validate' => true,
7070
'order' => 3,
71-
'type' => 'installer'
71+
'type' => 'install'
7272
],
7373
[
7474
'id' => 'root.web-configuration',
@@ -80,7 +80,7 @@
8080
'nav' => true,
8181
'validate' => true,
8282
'order' => 4,
83-
'type' => 'installer'
83+
'type' => 'install'
8484
],
8585
[
8686
'id' => 'root.customize-your-store',
@@ -91,7 +91,7 @@
9191
'controller' => 'customizeYourStoreController',
9292
'nav' => true,
9393
'order' => 5,
94-
'type' => 'installer'
94+
'type' => 'install'
9595
],
9696
[
9797
'id' => 'root.create-admin-account',
@@ -103,7 +103,7 @@
103103
'nav' => true,
104104
'validate' => true,
105105
'order' => 6,
106-
'type' => 'installer'
106+
'type' => 'install'
107107
],
108108
[
109109
'id' => 'root.install',
@@ -114,7 +114,7 @@
114114
'controller' => 'installController',
115115
'nav' => true,
116116
'order' => 7,
117-
'type' => 'installer'
117+
'type' => 'install'
118118
],
119119
[
120120
'id' => 'root.success',
@@ -123,7 +123,7 @@
123123
'controller' => 'successController',
124124
'main' => true,
125125
'order' => 8,
126-
'type' => 'installer'
126+
'type' => 'install'
127127
],
128128
],
129129
];

setup/pub/.htaccess

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<IfModule mod_headers.c>
2+
############################################
3+
## prevent clickjacking
4+
Header set X-Frame-Options SAMEORIGIN
5+
</IfModule>

setup/pub/magento/setup/component-grid.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ angular.module('component-grid', ['ngStorage'])
117117
if ($localStorage.titles['update'].indexOf(component.moduleName) < 0 ) {
118118
$localStorage.titles['update'] = 'Update ' + component.moduleName;
119119
}
120-
$localStorage.moduleName = component.moduleName;
120+
if (component.moduleName) {
121+
$localStorage.moduleName = component.moduleName;
122+
} else {
123+
$localStorage.moduleName = component.name;
124+
}
125+
121126
$scope.nextState();
122127
};
123128

@@ -131,7 +136,11 @@ angular.module('component-grid', ['ngStorage'])
131136
$localStorage.titles['uninstall'] = 'Uninstall ' + component.moduleName;
132137
}
133138
$localStorage.componentType = component.type;
134-
$localStorage.moduleName = component.moduleName;
139+
if (component.moduleName) {
140+
$localStorage.moduleName = component.moduleName;
141+
} else {
142+
$localStorage.moduleName = component.name;
143+
}
135144
$state.go('root.readiness-check-uninstall');
136145
};
137146

setup/pub/magento/setup/landing.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ angular.module('landing', ['ngStorage'])
1010
'$location',
1111
'$localStorage',
1212
function ($scope, $location, $localStorage) {
13-
$localStorage.$reset();
1413
$scope.selectLanguage = function () {
1514
$localStorage.lang = $scope.modelLanguage;
1615
window.location = 'index.php/' + $scope.modelLanguage + '/index';

setup/pub/magento/setup/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ main.controller('navigationController',
8383
}
8484

8585
$scope.goToStart = function() {
86-
if ($state.current.type === 'installer') {
87-
$state.go('root.landing-installer');
86+
if ($state.current.type === 'install') {
87+
$state.go('root.landing-install');
8888
} else if ($state.current.type === 'upgrade') {
8989
$state.go('root.upgrade');
9090
} else {
@@ -103,6 +103,7 @@ main.controller('navigationController',
103103
mainState: {},
104104
states: [],
105105
load: function () {
106+
$localStorage.$reset();
106107
var self = this;
107108
return $http.get('index.php/navigation').success(function (data) {
108109
var currentState = $location.path().replace('/', '');

setup/pub/magento/setup/readiness-check.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ angular.module('readiness-check', [])
156156
process: function(data) {
157157
$scope.extensions.processed = true;
158158
angular.extend($scope.extensions, data);
159-
$scope.extensions.length = Object.keys($scope.extensions.data.required).length;
159+
if(data.responseType !== 'error') {
160+
$scope.extensions.length = Object.keys($scope.extensions.data.required).length;
161+
}
160162
$scope.updateOnProcessed($scope.extensions.responseType);
161163
$scope.stopProgress();
162164
},
@@ -334,4 +336,27 @@ angular.module('readiness-check', [])
334336
$scope.progress();
335337
}
336338
});
339+
340+
$scope.wordingOfReadinessCheckAction = function() {
341+
var $actionString = 'We\'re making sure your server environment is ready for ';
342+
if ($localStorage.moduleName) {
343+
$actionString += $localStorage.moduleName;
344+
} else {
345+
if($state.current.type === 'install' || $state.current.type === 'upgrade') {
346+
$actionString += 'Magento';
347+
if ($state.current.type === 'upgrade' && $localStorage.packages.length > 1 ) {
348+
$actionString += ' and selected components';
349+
}
350+
} else {
351+
$actionString += 'package';
352+
}
353+
}
354+
$actionString += " to be " + $state.current.type;
355+
if ($scope.endsWith($state.current.type, 'e')) {
356+
$actionString += 'd';
357+
} else {
358+
$actionString +='ed';
359+
}
360+
return $actionString;
361+
}
337362
}]);

0 commit comments

Comments
 (0)