Last active
July 29, 2019 08:51
-
-
Save abdullahbutt/7db0df9179f9039ff3de8b0025d4579c to your computer and use it in GitHub Desktop.
megento 2.3.x blank page issue solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is Magento bug. Wrong paths to Windows are generated. The fixed fix is: | |
Magento 2.3.0 | |
#/vendor/magento/framework/View/Element/Template/File/Validator.php:138 | |
the string | |
$realPath = $this->fileDriver->getRealPath($path); | |
to replace | |
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path)); | |
Magento 2.2.7 | |
/vendor/magento/framework/View/Element/Template/File/Validator.php:113 | |
code | |
protected function isPathInDirectories($path, $directories) | |
{ | |
if (!is_array($directories)) { | |
$directories = (array)$directories; | |
} | |
foreach ($directories as $directory) { | |
if (0 === strpos($this->fileDriver->getRealPath($path), $directory)) { | |
return true; | |
} | |
} | |
return false; | |
} | |
to replace | |
protected function isPathInDirectories($path, $directories) | |
{ | |
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path)); | |
if (!is_array($directories)) { | |
$directories = (array)$directories; | |
} | |
foreach ($directories as $directory) { | |
if (0 === strpos($realPath, $directory)) { | |
return true; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment