From 0091e15d735db4fbe1cbd3555acb3553602d2804 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sun, 13 Feb 2022 15:48:38 +0000 Subject: [PATCH 1/2] Use per-store or per-website skin if available --- pub/errors/processor.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pub/errors/processor.php b/pub/errors/processor.php index ac335211f97e0..150b526d17b89 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -186,6 +186,15 @@ public function __construct( $this->_root = is_dir($this->_indexDir . 'app'); $this->_prepareConfig(); + + if (isset($_ENV['MAGE_RUN_CODE'])) { + $this->_setSkin($_ENV['MAGE_RUN_CODE']); + + if (isset($_ENV['MAGE_RUN_TYPE'])) { + $this->_setSkin($ENV_['MAGE_RUN_TYPE'] . '-' . $_ENV['MAGE_RUN_CODE']); + } + } + if (isset($_GET['skin'])) { $this->_setSkin($_GET['skin']); } From 051acf8e7f83df246a6a9fdbc3c5c25370ad7bba Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 20 Mar 2023 09:20:38 +0000 Subject: [PATCH 2/2] Permit dash in skin name --- pub/errors/processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pub/errors/processor.php b/pub/errors/processor.php index e4f896e672169..a63ce9342db17 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -738,7 +738,7 @@ protected function _validate() */ protected function _setSkin($value, \stdClass $config = null) { - if (preg_match('/^[a-z0-9_]+$/i', $value) && is_dir($this->_errorDir . $value)) { + if (preg_match('/^[a-z0-9_-]+$/i', $value) && is_dir($this->_errorDir . $value)) { if (!$config) { if ($this->_config) { $config = $this->_config;