Skip .svn dir. Leaving CVS dir in case it is left over in some people's downloaded...
[squirrelmail.git] / include / languages.php
index a1e301506e451ba656d539d73657a1df3cecf424..0fbcc34d3f979b9374c7050c6d328788215ac9a2 100644 (file)
@@ -14,7 +14,7 @@
  * existing PHP installation and implements fallback functions when required
  * functions are not available. Scripts in functions/ directory should not
  * setup anything when they are loaded.
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright © 1999-2007 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -191,7 +191,7 @@ function charset_decode ($charset, $string, $force_decode=false, $save_html=fals
 
     $decode=fixcharset($charset);
     $decodefile=SM_PATH . 'functions/decode/' . $decode . '.php';
-    if (file_exists($decodefile)) {
+    if ($decode != 'index' && file_exists($decodefile)) {
         include_once($decodefile);
         // send $save_html argument to decoding function. needed for iso-2022-xx decoding.
         $ret = call_user_func('charset_decode_'.$decode, $string, $save_html);
@@ -207,14 +207,14 @@ function charset_decode ($charset, $string, $force_decode=false, $save_html=fals
  * @param string $string
  * @param string $charset
  * @param boolean $htmlencode keep htmlspecialchars encoding
- * @param string
+ * @return string
  */
 function charset_encode($string,$charset,$htmlencode=true) {
     global $default_charset;
 
     $encode=fixcharset($charset);
     $encodefile=SM_PATH . 'functions/encode/' . $encode . '.php';
-    if (file_exists($encodefile)) {
+    if ($encode != 'index' && file_exists($encodefile)) {
         include_once($encodefile);
         $ret = call_user_func('charset_encode_'.$encode, $string);
     } elseif(file_exists(SM_PATH . 'functions/encode/us_ascii.php')) {
@@ -1002,7 +1002,7 @@ if (is_dir(SM_PATH . 'locale') &&
             $lang_dir = substr($lang_dir,0,-1);
         }
         if ($lang_dir != '..' && $lang_dir != '.' && $lang_dir != 'CVS' &&
-            is_dir(SM_PATH.'locale/'.$lang_dir) &&
+            $lang_dir != '.svn' && is_dir(SM_PATH.'locale/'.$lang_dir) &&
             file_exists(SM_PATH.'locale/'.$lang_dir.'/setup.php')) {
             include_once(SM_PATH.'locale/'.$lang_dir.'/setup.php');
         }
@@ -1103,4 +1103,3 @@ elseif ($gettext_flags == 0) {
         }
     }
 }
-?>
\ No newline at end of file