New Dev version strings.
[squirrelmail.git] / functions / strings.php
index f6ba0500b9fac3ceb263237e5775624f6bd04e87..8f278b12c115aa25c94a5282f61ba241281c1798 100644 (file)
  * $Id$
  */
 
-require_once(SM_PATH . 'functions/global.php');
 
 /**
  * SquirrelMail version number -- DO NOT CHANGE
  */
 global $version;
-$version = '1.4.0 [CVS-DEVEL]';
+$version = '1.5.0 [CVS]';
 
 /** 
  * SquirrelMail internal version number -- DO NOT CHANGE
  * $sm_internal_version = array (release, major, minor)
  */
 global $SQM_INTERNAL_VERSION;
-$SQM_INTERNAL_VERSION = array(1,4,0);
+$SQM_INTERNAL_VERSION = array(1,5,0);
 
 
+/**
+ * There can be a circular issue with includes, where the $version string is
+ * referenced by the include of global.php, etc. before it's defined.
+ * For that reason, bring in global.php AFTER we define the version strings.
+ */
+require_once(SM_PATH . 'functions/global.php');
+
 /**
  * Wraps text at $wrap characters
  *
@@ -38,6 +44,16 @@ $SQM_INTERNAL_VERSION = array(1,4,0);
  * This should not add newlines to the end of lines.
  */
 function sqWordWrap(&$line, $wrap) {
+    global $languages, $squirrelmail_language;
+
+    if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
+        function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
+        if (mb_detect_encoding($line) != 'ASCII') {
+            $line = $languages[$squirrelmail_language]['XTRA_CODE']('wordwrap', $line, $wrap);
+            return;
+        }
+    }
+
     ereg("^([\t >]*)([^\t >].*)?$", $line, $regs);
     $beginning_spaces = $regs[1];
     if (isset($regs[2])) {
@@ -83,6 +99,12 @@ function sqWordWrap(&$line, $wrap) {
  * Does the opposite of sqWordWrap()
  */
 function sqUnWordWrap(&$body) {
+    global $squirrelmail_language;
+    
+    if ($squirrelmail_language == 'ja_JP') {
+        return;
+    }
+
     $lines = explode("\n", $body);
     $body = '';
     $PreviousSpaces = '';
@@ -406,7 +428,7 @@ function GenerateRandomString($size, $chars, $flags = 0) {
     return $String;
 }
 
-function quoteIMAP($str) {
+function quoteimap($str) {
     return ereg_replace('(["\\])', '\\\\1', $str);
 }