next up previous contents
Next: tree.php Up: 目錄 functions Previous: page_header.php   Contents

strings.php

  1. 增加外掛相容性檢查函式。
    [root@mail squirrelmail-1.4.8]# diff -wuN ./functions/strings.php /var/www/squirrelmail/functions/strings.php
    --- ./functions/strings.php	2006-08-11 19:15:43.000000000 +0800
    +++ /var/www/squirrelmail/functions/strings.php	2012-05-05 09:48:51.000000000 +0800
    @@ -31,6 +31,7 @@
      * For that reason, bring in global.php AFTER we define the version strings.
      */
     require_once(SM_PATH . 'functions/global.php');
    +include_once(SM_PATH . 'plugins/compatibility/functions.php');
     
     /**
      * Wraps text at $wrap characters
    
  2. 因為是中文系統,要判斷中文字數必須改用 mb_strlen 函式,若字串過長,直接截取固定長度的中文字,後加...。
    @@ -143,10 +144,11 @@
     function truncateWithEntities($s, $iTrimAt) {
         global $languages, $squirrelmail_language;
     
    -    $ent_strlen = strlen($s);
    +    $ent_strlen = mb_strlen($s,'UTF-8'); //dywang
         if (($iTrimAt <= 0) || ($ent_strlen <= $iTrimAt))
             return $s;
     
    +	return mb_substr($s,0,$iTrimAt,'UTF-8'). '...'; //dywang
     
         if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
             function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
    



2016-03-11