Changeset 832
- Timestamp:
- 05/08/07 20:44:51 (2 years ago)
- Files:
-
- 1.8.3/branches/experimental/hdrs/game.h (modified) (1 diff)
- 1.8.3/branches/experimental/src/Makefile.in (modified) (2 diffs)
- 1.8.3/branches/experimental/src/game.c (modified) (3 diffs)
- 1.8.3/branches/experimental/src/htmltab.c (added)
- 1.8.3/branches/experimental/src/htmltab.gperf (added)
- 1.8.3/branches/experimental/src/markup.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/experimental/hdrs/game.h
r525 r832 19 19 extern void init_flagspaces(void); /* flags.c */ 20 20 extern void init_flag_table(const char *ns); /* flags.c */ 21 extern void init_tag_hashtab(void); /* funstr.c */22 21 extern void init_pronouns(void); /* funstr.c */ 23 22 1.8.3/branches/experimental/src/Makefile.in
r821 r832 140 140 fi 141 141 142 ../hdrs/patches.h: 143 if [ ! -f ../hdrs/patches.h ]; then \ 144 (cd ../utils; sh mkcmds.sh patches); \ 145 fi 146 147 ../po/pennmush.pot: $(C_FILES) $(H_FILES) 148 xgettext -d pennmush -kT -o ../po/pennmush.pot $(C_FILES) $(H_FILES) 149 150 151 htmltab.c: htmltab.gperf 152 gperf --output-file htmltab.c htmltab.gperf 142 153 143 154 etags: … … 1189 1200 markup.o: ../hdrs/log.h 1190 1201 markup.o: ../hdrs/game.h 1202 markup.o: htmltab.c 1191 1203 match.o: ../hdrs/copyrite.h 1192 1204 match.o: ../config.h 1.8.3/branches/experimental/src/game.c
r815 r832 727 727 init_func_hashtab(); 728 728 init_math_hashtab(); 729 init_tag_hashtab();730 729 init_ansi_codes(); 731 730 init_aname_table(); … … 2325 2324 extern HASHTAB htab_user_function; 2326 2325 extern HASHTAB htab_math; 2327 extern HASHTAB htab_tag;2328 2326 extern HASHTAB htab_player_list; 2329 2327 extern HASHTAB htab_reserved_aliases; … … 2348 2346 hash_stats(player, &htab_user_function, "@Functions"); 2349 2347 hash_stats(player, &htab_math, "Math funs"); 2350 hash_stats(player, &htab_tag, "HTML tags");2351 2348 hash_stats(player, &htab_player_list, "Players"); 2352 2349 hash_stats(player, &htab_reserved_aliases, "Aliases"); 1.8.3/branches/experimental/src/markup.c
r807 r832 66 66 /* Now the code */ 67 67 68 HASHTAB htab_tag; /**< Hash table of safe html tags */69 70 68 static int write_ansi_close(char *buff, char **bp); 71 69 static int is_ansi_oldstyle(const char *str); … … 76 74 compare_starts(const void *a, const void *b); 77 75 76 /* Functions in htmltab.c (Generated by gperf) */ 77 static unsigned int htmltag_hash(const char *s, unsigned int len); 78 static const char *is_allowed_tag(const char *tag, unsigned int len); 78 79 79 80 /* ARGSUSED */ … … 178 179 { 179 180 int i; 180 if (!Wizard(executor) && !hash_find(&htab_tag, strupper(args[0]))) { 181 if (!Wizard(executor) 182 && !is_allowed_tag(args[0], arglens[0])) { 181 183 safe_str("#-1", buff, bp); 182 184 return; … … 197 199 FUNCTION(fun_endtag) 198 200 { 199 if (!Wizard(executor) && ! hash_find(&htab_tag, strupper(args[0])))201 if (!Wizard(executor) && !is_allowed_tag(args[0], arglens[0])) 200 202 safe_str("#-1", buff, bp); 201 203 else … … 206 208 FUNCTION(fun_tagwrap) 207 209 { 208 if (!Wizard(executor) && ! hash_find(&htab_tag, strupper(args[0])))210 if (!Wizard(executor) && !is_allowed_tag(args[0], arglens[0])) 209 211 safe_str("#-1", buff, bp); 210 212 else { … … 2088 2090 } 2089 2091 2090 /** Initialize the html tag hash table with all the safe tags from HTML 4.0 */ 2091 void 2092 init_tag_hashtab(void) 2093 { 2094 static char dummy = 1; 2095 int i = 0; 2096 static const char *safetags[] = { "A", "B", "I", "U", "STRONG", "EM", 2097 "ADDRESS", "BLOCKQUOTE", "CENTER", "DEL", "DIV", 2098 "H1", "H2", "H3", "H4", "H5", "H6", "HR", "INS", 2099 "P", "PRE", "DIR", "DL", "DT", "DD", "LI", "MENU", "OL", "UL", 2100 "TABLE", "CAPTION", "COLGROUP", "COL", "THEAD", "TFOOT", 2101 "TBODY", "TR", "TD", "TH", 2102 "BR", "FONT", "IMG", "SPAN", "SUB", "SUP", 2103 "ABBR", "ACRONYM", "CITE", "CODE", "DFN", "KBD", "SAMP", "VAR", 2104 "BIG", "S", "SMALL", "STRIKE", "TT", 2105 NULL 2106 }; 2107 hashinit(&htab_tag, 64, 1); 2108 while (safetags[i]) { 2109 hashadd(safetags[i], (void *) &dummy, &htab_tag); 2110 i++; 2111 } 2112 } 2092 /* File generated by gperf */ 2093 #include "htmltab.c"
