diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-06-28 15:53:32 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-06-28 15:53:32 +0200 |
commit | a869ac25e174b7179f13557dd0a23840bf2cf327 (patch) | |
tree | 305479c14ab943d563f74b0d9a8786fae4c0deed | |
parent | 97a069df32404705b9c5782cae338a0ea39f4535 (diff) |
sfeed: fix check for div in atom content
as suspected it should match the tagname exactly "div", it would match <diva> too :P
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r-- | sfeed.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -499,11 +499,12 @@ xml_handler_attr(XMLParser *p, const char *tag, size_t taglen, static void xml_handler_start_element(XMLParser *p, const char *name, size_t namelen) { if(ctx.iscontenttag) { - /* starts with div, handle as XML, don't convert entities */ - /* TODO: test properly */ + /* starts with div, handle as XML, don't convert entities (set handle to NULL) */ if(ctx.item.feedtype == FeedTypeAtom && - !strncmp(name, "div", strlen("div"))) /* TODO: strncmp -> strcmp? */ + namelen == strlen("div") && + !strncmp(name, "div", strlen("div"))) { p->xmldataentity = NULL; + } } if(ctx.iscontent) { ctx.attrcount = 0; |