cvs: php4 /ext/ircg ircg.c

From: Date: Fri, 12 Jan 2001 15:45:34 +0000
Subject: cvs: php4 /ext/ircg ircg.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3573@lists.php.net to get a copy of this message
sas Fri Jan 12 07:45:34 2001 EDT Modified files: /php4/ext/ircg ircg.c Log: Encode HTML entities by default Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.19 php4/ext/ircg/ircg.c:1.20 --- php4/ext/ircg/ircg.c:1.19 Fri Jan 12 07:27:53 2001 +++ php4/ext/ircg/ircg.c Fri Jan 12 07:45:34 2001 @@ -19,6 +19,7 @@ #include "php.h" #include "php_ini.h" #include "php_ircg.h" +#include "ext/standard/html.h" #include "ext/standard/php_smart_str.h" #include "ext/standard/info.h" @@ -244,6 +245,7 @@ char c; int mode = 0; static smart_str new_msg; + smart_str encoded_msg = {0}; if (fmt[0] == '\0') { result->len = 0; @@ -253,6 +255,8 @@ if (msg) { new_msg.len = 0; mirc_color(msg, &new_msg); + encoded_msg.c = php_escape_html_entities(new_msg.c, new_msg.len, + &encoded_msg.len, 1, 1); } for (p = fmt; (c = *p); p++) { @@ -281,7 +285,7 @@ smart_str_appends_ex(result, from, 1); break; case 'm': - smart_str_append_ex(result, &new_msg, 1); + smart_str_append_ex(result, &encoded_msg, 1); break; default: smart_str_appendc_ex(result, '%', 1); @@ -291,6 +295,8 @@ break; } } + + smart_str_free(&encoded_msg); smart_str_0(result); }

« previous php.cvs (#3573) next »