/* {{{ http_module_dep */
#if ZEND_EXTENSION_API_NO >= 220050617
-static zend_module_dep http_module_dep[] = {
+static zend_module_dep http_module_deps[] = {
# ifdef HAVE_SPL
ZEND_MOD_REQUIRED("spl")
# endif
# ifdef HAVE_PHP_SESSION
ZEND_MOD_REQUIRED("session")
# endif
+#ifdef HAVE_ICONV
+ ZEND_MOD_REQUIRED("iconv")
+#endif
{NULL, NULL, NULL, 0}
};
#endif
zend_module_entry http_module_entry = {
#if ZEND_EXTENSION_API_NO >= 220050617
STANDARD_MODULE_HEADER_EX, NULL,
- http_module_dep,
+ http_module_deps,
#else
STANDARD_MODULE_HEADER,
#endif
#define HTTP_LOG_WRITE(file, type, msg) \
if (file && *file) { \
- php_stream *log = php_stream_open_wrapper(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); \
+ php_stream *log = php_stream_open_wrapper(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT); \
\
if (log) { \
php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \
RETURN_FALSE;
}
- if (!(stream = php_stream_open_wrapper(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL))) {
+ if (!(stream = php_stream_open_wrapper(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT))) {
RETURN_FALSE;
}
if (php_stream_stat(stream, &ssb)) {
/* {{{ proto bool HttpQueryString::iconv(string ie, string oe)
*
* Converts the query string from the source encoding ie to the target encoding oe.
+ * WARNING: Don't use any character set that can contain NUL bytes like UTF-16.
*
* Returns TRUE on success or FALSE on failure.
*/
case HTTP_PUT:
{
php_stream_statbuf ssb;
- php_stream *stream = php_stream_open_wrapper(Z_STRVAL_P(GET_PROP(putFile)), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
+ php_stream *stream = php_stream_open_wrapper(Z_STRVAL_P(GET_PROP(putFile)), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT);
if (stream && !php_stream_stat(stream, &ssb)) {
obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 1);
#define http_send_ex(d, s, m, nc) _http_send_ex((d), (s), (m), (nc) TSRMLS_CC)
PHP_HTTP_API STATUS _http_send_ex(const void *data, size_t data_size, http_send_mode mode, zend_bool no_cache TSRMLS_DC);
-#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL), 1, 0)
-#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL), 1, (nc))
+#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT), 1, 0)
+#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT), 1, (nc))
#define http_send_stream(s) http_send_stream_ex((s), 0, 0)
#define http_send_stream_ex(s, c, nc) _http_send_stream_ex((s), (c), (nc) TSRMLS_CC)
PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *s, zend_bool close_stream, zend_bool no_cache TSRMLS_DC);
"ACL, " \
/* END */
+#ifdef ZEND_ENGINE_2
+# include "ext/standard/file.h"
+# define HTTP_DEFAULT_STREAM_CONTEXT FG(default_context)
+#else
+# define HTTP_DEFAULT_STREAM_CONTEXT NULL
+#endif
#define HTTP_PHP_INI_ENTRY(entry, default, scope, updater, global) \
STD_PHP_INI_ENTRY(entry, default, scope, updater, global, zend_http_globals, http_globals)