Merging FIXME into one row.
[squirrelmail.git] / functions / strings.php
index 650c0f791d2a92a1fb13cb92a99346271fef723d..9383d83d09120c06c0b0f8bb67d59eb2171ea6f8 100644 (file)
@@ -523,7 +523,7 @@ function get_location () {
         if (sqgetGlobalVar('SERVER_PORT', $server_port, SQ_SERVER)) {
             if (($server_port != 80 && $proto == 'http://') ||
                 ($server_port != 443 && $proto == 'https://' &&
-                 $forwarded_proto != 'https')) {
+                 strcasecmp($forwarded_proto, 'https') !== 0)) {
                 $port = sprintf(':%d', $server_port);
             }
         }
@@ -545,6 +545,32 @@ function get_location () {
 }
 
 
+/**
+ * Get Message List URI
+ *
+ * @param string $mailbox      Current mailbox name (unencoded/raw)
+ * @param string $startMessage The mailbox page offset
+ * @param string $what         Any current search parameters (OPTIONAL; 
+ *                             default empty string)
+ *
+ * @return string The message list URI
+ *
+ * @since 1.5.2
+ *
+ */
+function get_message_list_uri($mailbox, $startMessage, $what='') {
+
+    global $base_uri;
+
+    $urlMailbox = urlencode($mailbox);
+
+    $list_xtra = "?where=read_body.php&what=$what&mailbox=" . $urlMailbox.
+                 "&startMessage=$startMessage";
+
+    return $base_uri .'src/right_main.php'. $list_xtra;
+}
+
+
 /**
  * Encrypts password
  *
@@ -717,11 +743,11 @@ function OneTimePadCreate ($length=100) {
  */
 function show_readable_size($bytes) {
     $bytes /= 1024;
-    $type = 'KiB';
+    $type = _("KiB");
 
     if ($bytes / 1024 > 1) {
         $bytes /= 1024;
-        $type = 'MiB';
+        $type = _("MiB");
     }
 
     if ($bytes < 10) {