Valider e8fa5e8d rédigé par JLuc's avatar JLuc
Parcourir les fichiers

text_truncate était généreusement foireux

fixes #3
parent e350597a
Chargement en cours
Chargement en cours
Chargement en cours
Chargement en cours
+280 −276
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -211,6 +211,10 @@ function text_truncate($text, $length = 100, $options = array()) {
      $options = array_merge($default, $options);
      extract($options);

      $html = $options['html'];
      $exact = $options['exact'];
      $ending = $options['ending'];

      if ($html) {
          if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {
              return $text;