* 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
$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))
}
/**
- * 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");
settype($bytes, 'integer');
}
- return $bytes . ' ' . $type;
+ global $nbsp;
+ return $bytes . $nbsp . $type;
}
/**
*
* @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;
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