Fixed few bugs regarding the charset changes just committed.
authorKasper Skårhøj <kasper@typo3.org>
Tue, 18 May 2004 10:06:08 +0000 (10:06 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Tue, 18 May 2004 10:06:08 +0000 (10:06 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@310 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_cs.php
t3lib/class.t3lib_div.php

index 6287040..c253e25 100755 (executable)
@@ -1140,7 +1140,7 @@ class t3lib_cs {
                if ($i === false)       {       // $len outside actual string length
                        return $string;
                } else  {
-                       if (abs($len)<strlen($string))  {
+                       if (abs($len)<$this->strlen($charset,$string))  {       // Has to use ->strlen() - otherwise multibyte strings ending with a multibyte char will return true here (which is not a catastrophe, but...)
                                if ($len > 0)   {
                                        return substr($string,0,$i).$crop;
                                } else {
@@ -1148,7 +1148,6 @@ class t3lib_cs {
                                }
                        }
                }
-
                return $string;
        }
 
index 5b80951..6c2574f 100755 (executable)
@@ -518,7 +518,7 @@ class t3lib_div {
         */
        function fixed_lgd_cs($string,$chars)   {
                if (is_object($GLOBALS['LANG']))        {
-                       return $GLOBALS['LANG']->csConvObj->crop($this->charSet,$string,$chars,'...');
+                       return $GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet,$string,$chars,'...');
                } else {
                        return t3lib_div::fixed_lgd($string, $chars);
                }