cvs: php-src /ext/standard head.c

From: Date: Thu, 19 Oct 2006 17:55:33 +0000
Subject: cvs: php-src /ext/standard head.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-41168@lists.php.net to get a copy of this message
andrei Thu Oct 19 17:55:33 2006 UTC Modified files: /php-src/ext/standard head.c Log: Unicode support for headers_sent(). http://cvs.php.net/viewvc.cgi/php-src/ext/standard/head.c?r1=1.90&r2=1.91&diff_format=u Index: php-src/ext/standard/head.c diff -u php-src/ext/standard/head.c:1.90 php-src/ext/standard/head.c:1.91 --- php-src/ext/standard/head.c:1.90 Mon Oct 16 19:27:00 2006 +++ php-src/ext/standard/head.c Thu Oct 19 17:55:33 2006 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.90 2006/10/16 19:27:00 tony2001 Exp $ */ +/* $Id: head.c,v 1.91 2006/10/19 17:55:33 andrei Exp $ */ #include <stdio.h> #include "php.h" @@ -191,7 +191,7 @@ /* }}} */ -/* {{{ proto bool headers_sent([string &$file [, int &$line]]) +/* {{{ proto bool headers_sent([string &$file [, int &$line]]) U Returns true if headers have already been sent, false otherwise */ PHP_FUNCTION(headers_sent) { @@ -208,17 +208,28 @@ } switch(ZEND_NUM_ARGS()) { - case 2: - zval_dtor(arg2); - ZVAL_LONG(arg2, line); - case 1: - zval_dtor(arg1); - if (file) { - ZVAL_STRING(arg1, file, 1); - } else { - ZVAL_STRING(arg1, "", 1); - } - break; + case 2: + zval_dtor(arg2); + ZVAL_LONG(arg2, line); + case 1: + zval_dtor(arg1); + if (UG(unicode)) { + UChar *ufile; + int ufile_len; + + if (file && SUCCESS == php_stream_path_decode(NULL, &ufile, &ufile_len, file, strlen(file), REPORT_ERRORS, FG(default_context))) { + ZVAL_UNICODEL(arg1, ufile, ufile_len, 0); + } else { + ZVAL_EMPTY_UNICODE(arg1); + } + } else { + if (file) { + ZVAL_STRING(arg1, file, 1); + } else { + ZVAL_STRING(arg1, "", 1); + } + } + break; } if (SG(headers_sent)) {

« previous php.cvs (#41168) next »