comparison libpurple/protocols/yahoo/util.c @ 16109:8e61e7be988b

Stop Yahoo sending SPAN tags, fixes Yahoo part of ticket 78
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 14 Apr 2007 17:07:52 +0000
parents 32c366eeeb99
children 47942d19f301
comparison
equal deleted inserted replaced
16108:6dab5732a4fd 16109:8e61e7be988b
620 } 620 }
621 i = j; 621 i = j;
622 break; 622 break;
623 } 623 }
624 } 624 }
625 } else if (!g_ascii_strncasecmp(&src[i+1], "SPAN", j - i - 1)) { /* drop span tags */
626 while (1) {
627 if (++j >= len) {
628 g_string_append(dest, &src[i]);
629 i = len;
630 break;
631 }
632 if (src[j] == '>') {
633 i = j;
634 break;
635 }
636 }
625 } else if (g_ascii_strncasecmp(&src[i+1], "FONT", j - i - 1)) { /* not interested! */ 637 } else if (g_ascii_strncasecmp(&src[i+1], "FONT", j - i - 1)) { /* not interested! */
626 while (1) { 638 while (1) {
627 if (++j >= len) { 639 if (++j >= len) {
628 g_string_append(dest, &src[i]); 640 g_string_append(dest, &src[i]);
629 i = len; 641 i = len;
666 g_string_append(dest, "\033[xlm"); 678 g_string_append(dest, "\033[xlm");
667 } else if (!g_ascii_strncasecmp(&src[i+1], "BR", sublen)) { 679 } else if (!g_ascii_strncasecmp(&src[i+1], "BR", sublen)) {
668 g_string_append_c(dest, '\n'); 680 g_string_append_c(dest, '\n');
669 } else if (!g_ascii_strncasecmp(&src[i+1], "/BODY", sublen)) { 681 } else if (!g_ascii_strncasecmp(&src[i+1], "/BODY", sublen)) {
670 /* mmm, </body> tags. *BURP* */ 682 /* mmm, </body> tags. *BURP* */
683 } else if (!g_ascii_strncasecmp(&src[i+1], "/SPAN", sublen)) {
684 /* </span> tags. dangerously close to </spam> */
671 } else if (!g_ascii_strncasecmp(&src[i+1], "/FONT", sublen) && g_queue_peek_tail(tags)) { 685 } else if (!g_ascii_strncasecmp(&src[i+1], "/FONT", sublen) && g_queue_peek_tail(tags)) {
672 char *etag, *cl; 686 char *etag, *cl;
673 687
674 etag = g_queue_pop_tail(tags); 688 etag = g_queue_pop_tail(tags);
675 if (etag) { 689 if (etag) {