瀏覽代碼

- fixed bug with word wrapping deleting last word
- renamed wordWrap() to sqWordWrap()
Applied patches:
- fix html errors in mailbox_display.php
- add a urlencode() in page_header.php

Luke Ehresman 25 年之前
父節點
當前提交
5f688d9fbf
共有 4 個文件被更改,包括 10 次插入9 次删除
  1. 5 4
      functions/mailbox_display.php
  2. 1 1
      functions/page_header.php
  3. 3 3
      functions/strings.php
  4. 1 1
      src/webmail.php

+ 5 - 4
functions/mailbox_display.php

@@ -50,10 +50,11 @@
       echo "   <td width=1% bgcolor=$hlt_color align=center><input type=checkbox name=\"msg[$t]\" value=".$msg["ID"]."$checked></TD>\n";
       echo "   <td width=30% bgcolor=$hlt_color>$italic$bold$flag$senderName$flag_end$bold_end$italic_end</td>\n";
       echo "   <td nowrap width=1% bgcolor=$hlt_color><center>$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end</center></td>\n";
-		if ($msg["FLAG_ANSWERED"] == true) echo "   <td bgcolor=$hlt_color width=1%><b><small>A</small></b></td>";
-		elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo "   <td bgcolor=$hlt_color width=1%><b><small><font color=$color[1]>!</font></small></b></td>";
-		else	echo "   <td bgcolor=$hlt_color width=1%>&nbsp;</td>";
-      echo "   <td bgcolor=$hlt_color width=%>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0$search_stuff\">$flag$subject$flag_end</a>$bold_end</td>\n";
+
+      if ($msg["FLAG_ANSWERED"] == true) echo "   <td bgcolor=$hlt_color width=1%><b><small>A</small></b></td>\n";
+      elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo "   <td bgcolor=$hlt_color width=1%><b><small><font color=$color[1]>!</font></small></b></td>\n";
+      else    echo "   <td bgcolor=$hlt_color width=1%>&nbsp;</td>\n";
+      echo "   <td bgcolor=$hlt_color>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0\">$flag$subject$flag_end</a>$bold_end</td>\n";
 
       echo "</tr>\n";
    }

+ 1 - 1
functions/page_header.php

@@ -89,7 +89,7 @@
       echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
       echo "   <TR>\n";
       echo "      <TD ALIGN=left WIDTH=\"99%\">\n";
-      $urlMailbox = $mailbox;
+      $urlMailbox = urlencode($mailbox);
       displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right");
       echo "&nbsp;&nbsp;\n";
       displayInternalLink ("src/addressbook.php", _("Addresses"), "right");

+ 3 - 3
functions/strings.php

@@ -45,7 +45,7 @@
    }
 
    // Wraps text at $wrap characters
-   function wordWrap($passed, $wrap) {
+   function sqWordWrap($passed, $wrap) {
       $passed = str_replace("&gt;", ">", $passed);
       $passed = str_replace("&lt;", "<", $passed);
 
@@ -54,7 +54,7 @@
       $line_len = strlen($words[$i])+1;
       $line = "";
       if (count($words) > 1) {   
-         while ($i < count($words)-1) {
+         while ($i < count($words)) {
             while ($line_len < $wrap) {
                $line = "$line$words[$i] ";
                $i++;
@@ -125,7 +125,7 @@
          $line = charset_decode($charset, $line);
          
          if (strlen($line) - 2 >= $wrap_at) {
-            $line = wordWrap($line, $wrap_at);  
+            $line = sqWordWrap($line, $wrap_at);  
          }
          
          $line = str_replace(" ", "&nbsp;", $line);

+ 1 - 1
src/webmail.php

@@ -64,7 +64,7 @@
    echo "</TITLE>";
    $ishelp = substr(getenv(REQUEST_URI),-8);			// If calling help, set left frame to 300
    if ($ishelp == "help.php") {			
-      echo "<FRAMESET COLS=\"300, *\" NORESIZE BORDER=0>";
+      echo "<FRAMESET COLS=\"300, *\" NORESIZE=yes BORDER=0>";
    } else {
       echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>";
    }