Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

OK, this should be better ...

  • Loading branch information...
commit a8afb411a0fba881d56bf12068a15778b4facf2f 1 parent c585fa1
authored October 26, 2002

Showing 1 changed file with 5 additions and 8 deletions. Show diff stats Hide diff stats

  1. 13  mod/forum/lib.php
13  mod/forum/lib.php
@@ -724,7 +724,7 @@ function forum_shorten_post($message) {
724 724
    $truncate = 0;
725 725
 
726 726
    for ($i=0; $i<$length; $i++) {
727  
-       $char = $string[$i];
  727
+       $char = $message[$i];
728 728
 
729 729
        switch ($char) {
730 730
            case "<": 
@@ -737,12 +737,13 @@ function forum_shorten_post($message) {
737 737
                if (!$tag) {
738 738
                    if ($stopzone) {
739 739
                        if ($char == " " or $char == ".") {
740  
-                           $truncate = $i;
  740
+                           $truncate = $i+1;
741 741
                            break 2;
742 742
                        }
743 743
                    }
744 744
                    $count++;
745 745
                }
  746
+               break;
746 747
        }
747 748
        if (!$stopzone) {
748 749
            if ($count > FORUM_SHORT_POST) {
@@ -752,14 +753,10 @@ function forum_shorten_post($message) {
752 753
    }
753 754
 
754 755
    if (!$truncate) {
755  
-       if ($i < FORUM_LONG_POST) {
756  
-           $truncate = $i;
757  
-       } else {
758  
-           $truncate = FORUM_LONG_POST;
759  
-       }
  756
+       $truncate = $i;
760 757
    }
761 758
 
762  
-   return substr($message, 0, $truncate);
  759
+   return substr($message, 0, $truncate)."<BR>";
763 760
 }
764 761
 
765 762
 

0 notes on commit a8afb41

Please sign in to comment.
Something went wrong with that request. Please try again.