version 1.174, 2014/09/28 20:14:20 |
version 1.177, 2014/10/26 17:12:03 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009, 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
Line 105 static const char *const htmlattrs[ATTR_MAX] = { |
|
Line 105 static const char *const htmlattrs[ATTR_MAX] = { |
|
"charset", /* ATTR_CHARSET */ |
"charset", /* ATTR_CHARSET */ |
"open", /* ATTR_OPEN */ |
"open", /* ATTR_OPEN */ |
"close", /* ATTR_CLOSE */ |
"close", /* ATTR_CLOSE */ |
|
"mathvariant", /* ATTR_MATHVARIANT */ |
}; |
}; |
|
|
static const char *const roffscales[SCALE_MAX] = { |
static const char *const roffscales[SCALE_MAX] = { |
Line 436 print_encode(struct html *h, const char *p, int norecu |
|
Line 437 print_encode(struct html *h, const char *p, int norecu |
|
case ESCAPE_UNICODE: |
case ESCAPE_UNICODE: |
/* Skip past "u" header. */ |
/* Skip past "u" header. */ |
c = mchars_num2uc(seq + 1, len - 1); |
c = mchars_num2uc(seq + 1, len - 1); |
if ('\0' != c) |
|
printf("&#x%x;", c); |
/* |
|
* XXX Security warning: |
|
* For now, forbid Unicode obfuscation of ASCII |
|
* characters. An audit of the callers is |
|
* required before this can be removed. |
|
*/ |
|
|
|
if (c < 0x80) |
|
c = 0xFFFD; |
|
|
|
printf("&#x%x;", c); |
break; |
break; |
case ESCAPE_NUMBERED: |
case ESCAPE_NUMBERED: |
c = mchars_num2char(seq, len); |
c = mchars_num2char(seq, len); |