CVS update: php3/functions

From: Date: Thu, 11 Feb 1999 19:09:34 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-4055@lists.php.net to get a copy of this message
Date: Thursday February 11, 1999 @ 14:09 Author: thies Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv7020/functions Modified Files: html.c html.h Log Message: htmlspecialchars and htmlentities are now "binary" save, we also do not need to copy the return value as it already has been emalloced (cosmetics;-) Index: php3/functions/html.c diff -c php3/functions/html.c:1.29 php3/functions/html.c:1.30 *** php3/functions/html.c:1.29 Wed Jan 6 02:19:06 1999 --- php3/functions/html.c Thu Feb 11 14:09:34 1999 *************** *** 28,34 **** +----------------------------------------------------------------------+ */ ! /* $Id: html.c,v 1.29 1999/01/06 07:19:06 fmk Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 28,34 ---- +----------------------------------------------------------------------+ */ ! /* $Id: html.c,v 1.30 1999/02/11 19:09:34 thies Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 60,73 **** "uuml","yacute","thorn","yuml" }; ! PHPAPI char * _php3_htmlentities(char *s, int all) { ! int i, len, maxlen; unsigned char *old; char *new; old = (unsigned char *)s; - i = strlen(s); maxlen = 2 * i; if (maxlen < 128) --- 60,72 ---- "uuml","yacute","thorn","yuml" }; ! PHPAPI char * _php3_htmlentities(char *s, int i, int all) { ! int len, maxlen; unsigned char *old; char *new; old = (unsigned char *)s; maxlen = 2 * i; if (maxlen < 128) *************** *** 116,125 **** convert_to_string(arg); ! new = _php3_htmlentities(arg->value.str.val, all); ! RETVAL_STRINGL(new,strlen(new),1); ! efree(new); } /* {{{ proto string htmlspecialchars(string string) --- 115,123 ---- convert_to_string(arg); ! new = _php3_htmlentities(arg->value.str.val, arg->value.str.len, all); ! RETVAL_STRINGL(new,strlen(new),0); } /* {{{ proto string htmlspecialchars(string string) Index: php3/functions/html.h diff -c php3/functions/html.h:1.8 php3/functions/html.h:1.9 *** php3/functions/html.h:1.8 Mon Jan 4 12:26:16 1999 --- php3/functions/html.h Thu Feb 11 14:09:34 1999 *************** *** 27,39 **** +----------------------------------------------------------------------+ */ ! /* $Id: html.h,v 1.8 1999/01/04 17:26:16 fmk Exp $ */ #ifndef _HTML_H #define _HTML_H extern void php3_htmlspecialchars(INTERNAL_FUNCTION_PARAMETERS); extern void php3_htmlentities(INTERNAL_FUNCTION_PARAMETERS); ! PHPAPI char * _php3_htmlentities(char *s, int all); #endif /* _HTML_H */ --- 27,39 ---- +----------------------------------------------------------------------+ */ ! /* $Id: html.h,v 1.9 1999/02/11 19:09:34 thies Exp $ */ #ifndef _HTML_H #define _HTML_H extern void php3_htmlspecialchars(INTERNAL_FUNCTION_PARAMETERS); extern void php3_htmlentities(INTERNAL_FUNCTION_PARAMETERS); ! PHPAPI char * _php3_htmlentities(char *s, int i, int all); #endif /* _HTML_H */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4055) next »