ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.216 by root, Sat Nov 17 10:40:08 2012 UTC vs.
Revision 1.217 by root, Wed Nov 21 13:23:10 2012 UTC

61 local $_ = $_[0]; 61 local $_ = $_[0];
62 62
63 s/&/&/g; 63 s/&/&/g;
64 s/>/>/g; 64 s/>/>/g;
65 s/</&lt;/g; 65 s/</&lt;/g;
66
67 $_
68}
69
70sub sanitise_cfxml($) {
71 local $_ = shift;
72
73 # we now weed out all tags we do not support
74 s{ <(?! /?i> | /?u> | /?b> | /?big | /?small | /?s | /?tt | fg\ | /fg>)
75 }{
76 "&lt;"
77 }gex;
78
79 # now all entities
80 s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&amp;/g;
81
82 # handle some elements
83 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs;
84 s/<fg name="([^"]*)">(.*?)<\/fg>/<span foreground="$1">$2<\/span>/gs;
85
86 s/\s+$//;
66 87
67 $_ 88 $_
68} 89}
69 90
70sub background(&;&) { 91sub background(&;&) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines