-
Notifications
You must be signed in to change notification settings - Fork 0
/
OCGISanitizer.m
40 lines (32 loc) · 909 Bytes
/
OCGISanitizer.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OCGIEncoding.h"
#import "OCGISanitizer.h"
@implementation OCGISanitizer
+(OCGIFormResultType) escapeHTML:(NSString *)s
{
cgiFormResultType status = \
cgiHtmlEscape([s cStringUsingEncoding:OCGI_ENCODING]);
return status;
}
+(OCGIFormResultType) escapeHTML:(NSString *)data length:(NSNumber *)len
{
cgiFormResultType status = \
cgiHtmlEscapeData(
[data cStringUsingEncoding:OCGI_ENCODING],
[len intValue]);
return status;
}
+(OCGIFormResultType) escapeValue:(NSString *)s
{
cgiFormResultType status = \
cgiValueEscape([s cStringUsingEncoding:OCGI_ENCODING]);
return status;
}
+(OCGIFormResultType) eacapeValue:(NSString *)data length:(NSNumber *)len
{
cgiFormResultType status = \
cgiValueEscapeData(
[data cStringUsingEncoding:OCGI_ENCODING],
[len intValue]);
return status;
}
@end