| 146 | | */ |
|---|
| 147 | | [string appendString:[inMessageString substringWithRange:searchRange]]; |
|---|
| 148 | | |
|---|
| | 147 | */ |
|---|
| | 148 | |
|---|
| | 149 | //[string appendString:[inMessageString substringWithRange:searchRange]]; |
|---|
| | 150 | //ikrieg commented to replace with the following |
|---|
| | 151 | loop = searchRange.location; |
|---|
| | 152 | while (loop < (searchRange.location + searchRange.length)) |
|---|
| | 153 | { |
|---|
| | 154 | long currentChar = [inMessageString characterAtIndex:loop]; |
|---|
| | 155 | |
|---|
| | 156 | if(currentChar == 60){ //replace less-than's (<) with their HTML code (<) |
|---|
| | 157 | //[string replaceCharactersInRange:NSMakeRange(loop, 1) withString:@"<"]; |
|---|
| | 158 | [string appendString:@"<"]; |
|---|
| | 159 | }else if(currentChar == 62){ //replace greater-than's (>) with their HTML code (>) |
|---|
| | 160 | //[string replaceCharactersInRange:NSMakeRange(loop, 1) withString:@">"]; |
|---|
| | 161 | [string appendString:@">"]; |
|---|
| | 162 | }else if(currentChar == '&'){ //replace with (&) (breaks links, but we'll deal with that later) |
|---|
| | 163 | //[string replaceCharactersInRange:NSMakeRange(loop, 1) withString:@"&"]; |
|---|
| | 164 | [string appendString:@"&"]; |
|---|
| | 165 | }else{ |
|---|
| | 166 | [string appendCharacter:currentChar]; |
|---|
| | 167 | } |
|---|
| | 168 | loop++; |
|---|
| | 169 | } |
|---|
| | 170 | |
|---|
| | 171 | //ikrieg end |
|---|