Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hruoho committed Sep 30, 2016
1 parent 8bba9c9 commit 88d2c06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/Toc.php
Expand Up @@ -455,7 +455,8 @@ protected function hyphenize($word, $language = null)
// Perform some language dependent replacements
$lang = $language ? [$language]: $this->language;
$replacements = self::getGrav()['language']->translate('PLUGINS.TOC.PATTERNS', $lang, true);
$text = preg_replace(array_keys($replacements), $replacements, $text);
if (is_array($replacements))
$text = preg_replace(array_keys($replacements), $replacements, $text);

// Trim
$text = trim($text, '-');
Expand Down

0 comments on commit 88d2c06

Please sign in to comment.