git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14438...
[squirrelmail.git] / include / languages.php
index b7c79ca0e0547ebab8523e8bee928b504b9fcc38..57b756e29c6fd547822cfa19ae8b5eaf39c9ccbc 100644 (file)
@@ -15,7 +15,7 @@
  * functions are not available. Scripts in functions/ directory should not
  * setup anything when they are loaded.
  *
- * @copyright © 1999-2009 The SquirrelMail Project Team
+ * @copyright 1999-2014 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -147,7 +147,7 @@ function sq_textdomain($domain) {
  * @param mixed $locale option contains array with possible locales or string with one locale
  * @return string name of set locale or false, if all locales fail.
  * @since 1.4.5 and 1.5.1
- * @see http://www.php.net/setlocale
+ * @see http://php.net/setlocale
  */
 function sq_setlocale($category,$locale) {
     if (is_string($locale)) {
@@ -193,7 +193,7 @@ function sq_setlocale($category,$locale) {
  * @param string $string Text to be decoded
  * @param boolean $force_decode converts string to html without $charset!=$default_charset check.
  * Argument is available since 1.4.5 and 1.5.1.
- * @param boolean $save_html disables htmlspecialchars() in order to preserve
+ * @param boolean $save_html disables sm_encode_html_special_chars() in order to preserve
  *  html formating. Use with care. Available since 1.4.6 and 1.5.1
  * @return string decoded string
  */
@@ -218,7 +218,7 @@ function charset_decode ($charset, $string, $force_decode=false, $save_html=fals
 
     // Don't do conversion if charset is the same.
     if ( ! $force_decode && $charset == strtolower($default_charset) )
-        return ($save_html ? $string : htmlspecialchars($string));
+        return ($save_html ? $string : sm_encode_html_special_chars($string));
 
     // catch iso-8859-8-i thing
     if ( $charset == "iso-8859-8-i" )
@@ -234,10 +234,10 @@ function charset_decode ($charset, $string, $force_decode=false, $save_html=fals
             // other charsets can be converted to utf-8 without loss.
             // and output string is smaller
             $string = recode_string($charset . "..utf-8",$string);
-            return ($save_html ? $string : htmlspecialchars($string));
+            return ($save_html ? $string : sm_encode_html_special_chars($string));
         } else {
             $string = recode_string($charset . "..html",$string);
-            // recode does not convert single quote, htmlspecialchars does.
+            // recode does not convert single quote, sm_encode_html_special_chars does.
             $string = str_replace("'", ''', $string);
             // undo html specialchars
             if ($save_html)
@@ -250,13 +250,13 @@ function charset_decode ($charset, $string, $force_decode=false, $save_html=fals
     // iconv functions does not have html target and can be used only with utf-8
     if ( $use_php_iconv && $default_charset=='utf-8') {
         $string = iconv($charset,$default_charset,$string);
-        return ($save_html ? $string : htmlspecialchars($string));
+        return ($save_html ? $string : sm_encode_html_special_chars($string));
     }
 
     // If we don't use recode and iconv, we'll do it old way.
 
     /* All HTML special characters are 7 bit and can be replaced first */
-    if (! $save_html) $string = htmlspecialchars ($string);
+    if (! $save_html) $string = sm_encode_html_special_chars ($string);
 
     /* controls cpu and memory intensive decoding cycles */
     if (! isset($aggressive_decoding) || $aggressive_decoding=="" ) {
@@ -279,7 +279,7 @@ function charset_decode ($charset, $string, $force_decode=false, $save_html=fals
  * @since 1.4.4 and 1.5.1
  * @param string $string
  * @param string $charset
- * @param boolean $htmlencode keep htmlspecialchars encoding
+ * @param boolean $htmlencode keep sm_encode_html_special_chars encoding
  * @return string
  */
 function charset_encode($string,$charset,$htmlencode=true) {
@@ -323,7 +323,7 @@ function charset_encode($string,$charset,$htmlencode=true) {
  * @param string $in_charset initial charset
  * @param string $string string that has to be converted
  * @param string $out_charset final charset
- * @param boolean $htmlencode keep htmlspecialchars encoding
+ * @param boolean $htmlencode keep sm_encode_html_special_chars encoding
  * @return string converted string
  */
 function charset_convert($in_charset,$string,$out_charset,$htmlencode=true) {
@@ -565,7 +565,7 @@ function set_up_language($sm_language, $do_search = false, $default = false,
          * mbstring.func_overload fix (#929644).
          *
          * php mbstring extension can replace standard string functions with their multibyte
-         * equivalents. See http://www.php.net/ref.mbstring#mbstring.overload. This feature
+         * equivalents. See http://php.net/ref.mbstring#mbstring.overload. This feature
          * was added in php v.4.2.0
          *
          * Some SquirrelMail functions work with 8bit strings in bytes. If interface is forced
@@ -1058,7 +1058,7 @@ if (! sqgetGlobalVar('squirrelmail_language',$squirrelmail_language,SQ_COOKIE))
  *  ALTNAME   - Native translation name. Any 8bit symbols must be html encoded.
  *  LOCALE    - Full locale name (in xx_XX.charset format). It can use array with more than one locale name since 1.4.5 and 1.5.1
  *  DIR       - Text direction. Used to define Right-to-Left languages. Possible values 'rtl' or 'ltr'. If undefined - defaults to 'ltr'
- *  XTRA_CODE - translation uses special functions. See http://www.squirrelmail.org/docs/devel/devel-3.html
+ *  XTRA_CODE - translation uses special functions. See http://squirrelmail.org/docs/devel/devel-3.html
  *
  * Each 'language' definition requires NAME+CHARSET or ALIAS variables.
  *