* htmlCheckMeta: * @ctxt: an HTML parser context * @atts: the attributes values * * Checks an attributes from a Meta tag */
| 3706 | * Checks an attributes from a Meta tag |
| 3707 | */ |
| 3708 | static void |
| 3709 | htmlCheckMeta(htmlParserCtxtPtr ctxt, const xmlChar **atts) { |
| 3710 | int i; |
| 3711 | const xmlChar *att, *value; |
| 3712 | int http = 0; |
| 3713 | const xmlChar *content = NULL; |
| 3714 | |
| 3715 | if ((ctxt == NULL) || (atts == NULL)) |
| 3716 | return; |
| 3717 | |
| 3718 | i = 0; |
| 3719 | att = atts[i++]; |
| 3720 | while (att != NULL) { |
| 3721 | value = atts[i++]; |
| 3722 | if (value != NULL) { |
| 3723 | if ((!xmlStrcasecmp(att, BAD_CAST "http-equiv")) && |
| 3724 | (!xmlStrcasecmp(value, BAD_CAST "Content-Type"))) { |
| 3725 | http = 1; |
| 3726 | } else if (!xmlStrcasecmp(att, BAD_CAST "charset")) { |
| 3727 | xmlChar *copy; |
| 3728 | |
| 3729 | copy = xmlStrdup(value); |
| 3730 | if (copy == NULL) |
| 3731 | htmlErrMemory(ctxt); |
| 3732 | xmlSetDeclaredEncoding(ctxt, copy); |
| 3733 | } else if (!xmlStrcasecmp(att, BAD_CAST "content")) { |
| 3734 | content = value; |
| 3735 | } |
| 3736 | } |
| 3737 | att = atts[i++]; |
| 3738 | } |
| 3739 | if ((http) && (content != NULL)) |
| 3740 | htmlCheckEncoding(ctxt, content); |
| 3741 | |
| 3742 | } |
| 3743 | |
| 3744 | /** |
| 3745 | * htmlParseStartTag: |
no test coverage detected