<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -87,7 +87,7 @@ class StringFilters extends FilterCollection {
     }
     
     static function truncate ($string, $max = 50, $ends = '...') {
-        return str_replace($string, $ends, $max - strlen($ends));
+		return (strlen($string) &gt; $max ? substr($string, 0, $max).$ends : $string);
     }
     
     static function limitwords($text, $limit = 50, $ends = '...') {</diff>
      <filename>h2o/filters.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b5dfd5487ef9609fa641dd58d1a7dbaa47b9a18b</id>
    </parent>
  </parents>
  <author>
    <name>Jeff Long</name>
    <email>jeff.long@gmail.com</email>
  </author>
  <url>http://github.com/speedmax/h2o-php/commit/1bae7a831ce4ba24eecdb61c13b7b5e2055e0909</url>
  <id>1bae7a831ce4ba24eecdb61c13b7b5e2055e0909</id>
  <committed-date>2009-06-02T22:45:14-07:00</committed-date>
  <authored-date>2009-06-02T20:07:06-07:00</authored-date>
  <message>Fixed truncate filter, returns truncated text now.

Signed-off-by: Taylor luk &lt;subjective@gmail.com&gt;</message>
  <tree>25b3408412b23e6216440af2fd09352364eea307</tree>
  <committer>
    <name>Taylor luk</name>
    <email>subjective@gmail.com</email>
  </committer>
</commit>
