mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
NULL-safe escapeHTML:
This commit is contained in:
@@ -242,6 +242,8 @@
|
||||
|
||||
+ (NSString *) escapeHTML:(NSString *)txt
|
||||
{
|
||||
if (txt == nil)
|
||||
return txt;
|
||||
NSMutableString *newTxt = [NSMutableString stringWithString:txt];
|
||||
[newTxt replaceOccurrencesOfString:@"&" withString:@"&" options:NSLiteralSearch range:NSMakeRange(0, [newTxt length])];
|
||||
[newTxt replaceOccurrencesOfString:@"<" withString:@"<" options:NSLiteralSearch range:NSMakeRange(0, [newTxt length])];
|
||||
|
||||
Reference in New Issue
Block a user