moriyoshi Mon Feb 24 17:48:39 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard file.c Log: MFH: made fgetss() binary safe too Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.279.2.11 php4/ext/standard/file.c:1.279.2.12 --- php4/ext/standard/file.c:1.279.2.11 Sun Feb 23 22:15:53 2003 +++ php4/ext/standard/file.c Mon Feb 24 17:48:39 2003 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.279.2.11 2003/02/24 03:15:53 iliaa Exp $ */ +/* $Id: file.c,v 1.279.2.12 2003/02/24 22:48:39 moriyoshi Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1390,6 +1390,7 @@ { zval **fd, **bytes, **allow=NULL; int len; + size_t actual_len, retval_len; char *buf; php_stream *stream; char *allowed_tags=NULL; @@ -1428,15 +1429,15 @@ /*needed because recv doesnt set null char at end*/ memset(buf, 0, len + 1); - if (php_stream_gets(stream, buf, len) == NULL) { + if (php_stream_get_line(stream, buf, len, &actual_len) == NULL) { efree(buf); RETURN_FALSE; } /* strlen() can be used here since we are doing it on the return of an fgets() anyway */ - php_strip_tags(buf, strlen(buf), &stream->fgetss_state, allowed_tags, allowed_tags_len); + retval_len = php_strip_tags(buf, actual_len, &stream->fgetss_state, allowed_tags, allowed_tags_len); - RETURN_STRING(buf, 0); + RETURN_STRINGL(buf, retval_len, 0); } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php