Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
Rtrimmed truncated value.
Browse files Browse the repository at this point in the history
  • Loading branch information
umpirsky committed Jun 27, 2012
1 parent feb6d3f commit d67bc7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Twig/Extensions/Extension/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $pres
}
}

return mb_substr($value, 0, $length, $env->getCharset()) . $separator;
return rtrim(mb_substr($value, 0, $length, $env->getCharset())) . $separator;
}

return $value;
Expand Down Expand Up @@ -96,7 +96,7 @@ function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $pres
}
}

return substr($value, 0, $length) . $separator;
return rtrim(substr($value, 0, $length)) . $separator;
}

return $value;
Expand Down

0 comments on commit d67bc7e

Please sign in to comment.