Skip to content
Snippets Groups Projects
Commit 8a0234cf authored by Bohdan Korablov's avatar Bohdan Korablov
Browse files

Merge remote-tracking branch 'falcons/MAGETWO-60792' into MAGETWO-60647

parents 9269429c 7c34902c
Branches
No related merge requests found
...@@ -241,8 +241,7 @@ class Http implements \Magento\Framework\AppInterface ...@@ -241,8 +241,7 @@ class Http implements \Magento\Framework\AppInterface
. "because the Magento setup directory cannot be accessed. \n" . "because the Magento setup directory cannot be accessed. \n"
. 'You can install Magento using either the command line or you must restore access ' . 'You can install Magento using either the command line or you must restore access '
. 'to the following directory: ' . $setupInfo->getDir($projectRoot) . "\n"; . 'to the following directory: ' . $setupInfo->getDir($projectRoot) . "\n";
$newMessage .= 'If you are using the sample nginx configuration, please go to '
. $this->_request->getScheme(). '://' . $this->_request->getHttpHost() . $setupInfo->getUrl();
throw new \Exception($newMessage, 0, $exception); throw new \Exception($newMessage, 0, $exception);
} }
} }
......
...@@ -147,6 +147,14 @@ class SetupInfo ...@@ -147,6 +147,14 @@ class SetupInfo
{ {
$setupDir = $this->getDir($this->projectRoot); $setupDir = $this->getDir($this->projectRoot);
$isSubDir = false !== strpos($setupDir . '/', $this->docRoot . '/'); $isSubDir = false !== strpos($setupDir . '/', $this->docRoot . '/');
// Setup is not accessible from pub folder
$setupDir = rtrim($setupDir, '/');
$lastOccurrence = strrpos($setupDir, '/pub/setup');
if (false !== $lastOccurrence) {
$setupDir = substr_replace($setupDir, '/setup', $lastOccurrence, strlen('/pub/setup'));
}
return $isSubDir && realpath($setupDir); return $isSubDir && realpath($setupDir);
} }
......
...@@ -193,6 +193,13 @@ class SetupInfoTest extends \PHPUnit_Framework_TestCase ...@@ -193,6 +193,13 @@ class SetupInfoTest extends \PHPUnit_Framework_TestCase
], ],
true true
], ],
'root within doc root + pub, existent sub-directory' => [
[
'DOCUMENT_ROOT' => __DIR__ . '/_files/pub/',
'SCRIPT_FILENAME' => __DIR__ . '/_files/pub/index.php',
],
true
],
]; ];
} }
} }
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
...@@ -11,6 +11,10 @@ php_flag engine 0 ...@@ -11,6 +11,10 @@ php_flag engine 0
AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI Options -ExecCGI
<FilesMatch ".+\.(ph(p[3457]?|t|tml)|[aj]sp|p[ly]|sh|cgi|shtml?|html?)$">
SetHandler default-handler
</FilesMatch>
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
############################################ ############################################
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment