Changeset 52bce2c89d6bd18c5c3ce1e3cc1ad93512749dfd

Show
Ignore:
Timestamp:
04/30/07 23:11:24 (2 years ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1177967484 +0200
git-parent:

[c0bc36490c47967a578fdea01c5544d3bed10a91]

git-author:
Christopher Jung <bktheg@web.de> 1177967484 +0200
Message:

Verarbeitung unvollstaendiger Tags am Ende des Textes gefixt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/framework/bbcode/BBCodeParser.java

    r79c7e32 r52bce2c  
    180180                         
    181181                        // Schliessenden Tag bestimmen 
     182                        // Dazu gleiche Tags (oeffnende und schliessende) zaehlen, bis der counter unter 0 faellt 
    182183                        int closetag = -1; 
    183184                        int counter = 0; 
     
    194195                                } 
    195196                                else if( (text.charAt(tagIndex-1) == '/') && (text.charAt(tagIndex-2) == '[') ) { 
     197                                        // Check, ob ueberhaupt noch genug Platz fuer den Endtag ist 
     198                                        if( text.length() - tagIndex <= tag.length() ) { 
     199                                                break; 
     200                                        } 
     201                                         
     202                                        // Check, ob dies wirklich ein Endtag ist, er also mit einem ] beendet wird 
     203                                        if( text.charAt(tagIndex+tag.length()) != ']' ) { 
     204                                                continue; 
     205                                        } 
     206                                         
    196207                                        counter--; 
    197208                                        if( counter < 0 ) { 
     
    250261                } 
    251262                 
    252                 buffer.append(text.substring(textIndex)); 
     263                if( textIndex < text.length()-1 ) { 
     264                        buffer.append(text.substring(textIndex)); 
     265                } 
     266 
    253267                return buffer; 
    254268        }