diff options
Diffstat (limited to 'lib/classes/Icon.class.php')
| -rw-r--r-- | lib/classes/Icon.class.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/classes/Icon.class.php b/lib/classes/Icon.class.php index ca0b9e0..6c586a0 100644 --- a/lib/classes/Icon.class.php +++ b/lib/classes/Icon.class.php @@ -338,7 +338,7 @@ class Icon $classNames = 'icon-role-' . $this->role; if (!self::isStatic($this->shape)) { - $classNames .= ' icon-shape-' . $this->shape; + $classNames .= ' icon-shape-' . $this->shapeToPath($this->shape); } $result['class'] = isset($result['class']) ? $result['class'] . ' ' . $classNames : $classNames; @@ -385,8 +385,11 @@ class Icon // transforms a shape w/ possible additions (`shape`) to a path `(addition/)?shape` private function shapeToPath() { - return self::isStatic($this->shape) - ? $this->shape : - join('/', array_reverse(explode('+', preg_replace('/\.svg$/', '', $this->shape)))); + if (self::isStatic($this->shape)) { + return $this->shape; + } + $shape = array_reverse(explode('/', $this->shape))[0]; + $shape = explode('+', $shape)[0]; + return $shape; } } |
