[Pidgin] #13485: purple_markup_html_to_xhtml fails to handle comments

Pidgin trac at pidgin.im
Thu Mar 10 00:28:26 EST 2011


#13485: purple_markup_html_to_xhtml fails to handle comments
--------------------+-------------------------------------------------------
 Reporter:  loic    |        Owner:           
     Type:  defect  |       Status:  new      
Milestone:          |    Component:  libpurple
  Version:  2.7.10  |   Resolution:           
 Keywords:          |  
--------------------+-------------------------------------------------------
Description changed by loic:

Old description:

> in libpurple/util.c
> {{{
>                                 if(!g_ascii_strncasecmp(c, "<!--",
> strlen("<!--"))) {
>                                         char *p = strstr(c +
> strlen("<!--"), "-->");
>                                         if(p) {
>                                                 if(xhtml)
>                                                         xhtml =
> g_string_append(xhtml, "<!--");
>                                                 c += strlen("<!--");
>                                                 continue;
>                                         }
>                                 }
> }}}
> is wrong and leads to the following
> {{{
>         purple_markup_html_to_xhtml("<!--COMMENT-->", &xhtml,
> &plaintext);
>         assert_string_equal_free("<!--COMMENT-->", xhtml);
>         assert_string_equal_free("COMMENT-->", plaintext);
> }}}
> which can be addede to {{{START_TEST(test_markup_html_to_xhtml)}}} in the
> libpurple/tests/test_util.c file.

New description:

 in libpurple/util.c
 {{{
                                 if(!g_ascii_strncasecmp(c, "<!--",
 strlen("<!--"))) {
                                         char *p = strstr(c +
 strlen("<!--"), "-->");
                                         if(p) {
                                                 if(xhtml)
                                                         xhtml =
 g_string_append(xhtml, "<!--");
                                                 c += strlen("<!--");
                                                 continue;
                                         }
                                 }
 }}}
 is wrong and leads to the following
 {{{
         purple_markup_html_to_xhtml("<!--COMMENT-->", &xhtml, &plaintext);
         assert_string_equal_free("<!--COMMENT-->", xhtml);
         assert_string_equal_free("COMMENT-->", plaintext);
 }}}
 which can be added to {{{START_TEST(test_markup_html_to_xhtml)}}} in the
 libpurple/tests/test_util.c file.

--

-- 
Ticket URL: <http://developer.pidgin.im/ticket/13485#comment:2>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list