Fix notice when image is missing
[squirrelmail.git] / functions / strings.php
index 23e9d9b1384cef73ac6e08fb74344a935e03b996..a830024fc0a06f66bbfcf0be2ac5e663d57da32a 100644 (file)
@@ -6,7 +6,7 @@
  * This code provides various string manipulation functions that are
  * used by the rest of the SquirrelMail code.
  *
- * @copyright © 1999-2005 The SquirrelMail Project Team
+ * @copyright © 1999-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -19,14 +19,14 @@ if (!defined('SM_PATH')) define('SM_PATH','../');
  * SquirrelMail version number -- DO NOT CHANGE
  */
 global $version;
-$version = '1.5.1 [CVS]';
+$version = '1.5.2 [CVS]';
 
 /**
  * SquirrelMail internal version number -- DO NOT CHANGE
  * $sm_internal_version = array (release, major, minor)
  */
 global $SQM_INTERNAL_VERSION;
-$SQM_INTERNAL_VERSION = array(1,5,1);
+$SQM_INTERNAL_VERSION = array(1,5,2);
 
 /**
  * There can be a circular issue with includes, where the $version string is
@@ -39,7 +39,7 @@ include_once(SM_PATH . 'functions/global.php');
  * Include Compatibility plugin if available.
  */
 if (file_exists(SM_PATH . 'plugins/compatibility/functions.php'))
-    include_once(SM_PATH . 'plugins/compatibility/functions.php'));
+    include_once(SM_PATH . 'plugins/compatibility/functions.php');
 
 /**
  * Appends citation markers to the string.
@@ -1174,9 +1174,10 @@ function sq_strlen($str, $charset=null){
 
     // use automatic charset detection, if function call asks for it
     if ($charset=='auto') {
-        global $default_charset;
+        global $default_charset, $squirrelmail_language;
         set_my_charset();
         $charset=$default_charset;
+        if ($squirrelmail_language=='ja_JP') $charset='euc-jp';
     }
 
     // Use mbstring only with listed charsets
@@ -1241,9 +1242,10 @@ function sq_str_pad($string, $width, $pad, $padtype, $charset='') {
 function sq_substr($string,$start,$length,$charset='auto') {
     // use automatic charset detection, if function call asks for it
     if ($charset=='auto') {
-        global $default_charset;
+        global $default_charset, $squirrelmail_language;
         set_my_charset();
         $charset=$default_charset;
+        if ($squirrelmail_language=='ja_JP') $charset='euc-jp';
     }
     $charset = strtolower($charset);
     if (function_exists('mb_internal_encoding') &&
@@ -1271,9 +1273,10 @@ function sq_substr($string,$start,$length,$charset='auto') {
 function sq_strpos($haystack,$needle,$offset,$charset='auto') {
     // use automatic charset detection, if function call asks for it
     if ($charset=='auto') {
-        global $default_charset;
+        global $default_charset, $squirrelmail_language;
         set_my_charset();
         $charset=$default_charset;
+        if ($squirrelmail_language=='ja_JP') $charset='euc-jp';
     }
     $charset = strtolower($charset);
     if (function_exists('mb_internal_encoding') &&
@@ -1299,9 +1302,10 @@ function sq_strpos($haystack,$needle,$offset,$charset='auto') {
 function sq_strtoupper($string,$charset='auto') {
     // use automatic charset detection, if function call asks for it
     if ($charset=='auto') {
-        global $default_charset;
+        global $default_charset,$squirrelmail_language;
         set_my_charset();
         $charset=$default_charset;
+        if ($squirrelmail_language=='ja_JP') $charset='euc-jp';
     }
     $charset = strtolower($charset);
     if (function_exists('mb_strtoupper') &&