From 468ed5e3a10adde567cd264fedc7152f3c20ea71 Mon Sep 17 00:00:00 2001 From: AndresInSpace <14356094+AndresInSpace@users.noreply.github.com> Date: Fri, 25 Jan 2019 09:55:18 -0500 Subject: [PATCH] Fix whitespace in addBodyClass($className) if no result from $this->getBodyClass() output just classname instead of null+whitespace+classname --- app/code/core/Mage/Page/Block/Html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Page/Block/Html.php b/app/code/core/Mage/Page/Block/Html.php index 4975e65cda8..6a718f217c1 100644 --- a/app/code/core/Mage/Page/Block/Html.php +++ b/app/code/core/Mage/Page/Block/Html.php @@ -131,7 +131,8 @@ public function getHeaderTitle() public function addBodyClass($className) { $className = preg_replace('#[^a-z0-9]+#', '-', strtolower($className)); - $this->setBodyClass($this->getBodyClass() . ' ' . $className); + $class = $this->getBodyClass() ? $this->getBodyClass() . ' ' . $className : $className; + $this->setBodyClass($class); return $this; }