add labels to login page
[squirrelmail.git] / functions / strings.php
index b4b69eba5f355dde328d5fbd01db017e3d567719..944177d9d1523a3833522df5b89159eadbd0a90e 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-2007 The SquirrelMail Project Team
+ * @copyright © 1999-2009 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -510,12 +510,11 @@ function get_location () {
     $port = '';
     if (! strstr($host, ':')) {
         // Note: HTTP_X_FORWARDED_PROTO could be sent from the client and
-        //       therefore possibly spoofed/hackable - for now, the
-        //       administrator can tell SM to ignore this value by setting
-        //       $sq_ignore_http_x_forwarded_headers to boolean TRUE in
-        //       config/config_local.php, but in the future we may
-        //       want to default this to TRUE and make administrators
-        //       who use proxy systems turn it off (see 1.5.2+).
+        //       therefore possibly spoofed/hackable.  Thus, SquirrelMail
+        //       ignores such headers by default.  The administrator
+        //       can tell SM to use such header values by setting
+        //       $sq_ignore_http_x_forwarded_headers to boolean FALSE
+        //       in config/config.php or by using config/conf.pl.
         global $sq_ignore_http_x_forwarded_headers;
         if ($sq_ignore_http_x_forwarded_headers
          || !sqgetGlobalVar('HTTP_X_FORWARDED_PROTO', $forwarded_proto, SQ_SERVER))
@@ -656,12 +655,16 @@ function OneTimePadCreate ($length=100) {
 }
 
 /**
- * Returns a string showing the size of the message/attachment.
- *
- * @param int $bytes the filesize in bytes
- * @return string the filesize in human readable format
- * @since 1.0
- */
+  * Returns a string showing a byte size figure in
+  * a more easily digested (readable) format
+  *
+  * @param int $bytes the size in bytes
+  *
+  * @return string The size in human readable format
+  *
+  * @since 1.0
+  *
+  */
 function show_readable_size($bytes) {
     $bytes /= 1024;
     $type = _("KiB");
@@ -679,7 +682,8 @@ function show_readable_size($bytes) {
         settype($bytes, 'integer');
     }
 
-    return $bytes . ' ' . $type;
+    global $nbsp;
+    return $bytes . $nbsp . $type;
 }
 
 /**
@@ -745,7 +749,7 @@ function quoteimap($str) {
  *
  * @since 1.4.2
  */
-function makeComposeLink($url, $text = null, $target='', $accesskey='') {
+function makeComposeLink($url, $text = null, $target='', $accesskey='NONE') {
     global $compose_new_win, $compose_width, 
            $compose_height, $oTemplate;
 
@@ -770,7 +774,9 @@ function makeComposeLink($url, $text = null, $target='', $accesskey='') {
         return create_hyperlink('javascript:void(0)', $text, '',
                                 "comp_in_new('$compuri','$compose_width','$compose_height')",
                                 '', '', '',
-                                (empty($accesskey) ? array() : array('accesskey' => $accesskey)));
+                                ($accesskey == 'NONE'
+                                ? array()
+                                : array('accesskey' => $accesskey)));
     }
 
     // otherwise, just open new window using regular HTML