summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2010-11-05 01:29:08 +0000
committerGustavo André dos Santos Lopes <cataphract@php.net>2010-11-05 01:29:08 +0000
commit0a351335249697ef3fe0b2f9441cf30ad5cb8499 (patch)
tree5263793b4f3c02dbd87e8e764a4a0326a2c78635 /main/php_streams.h
parent6f1cfe3e7fe7ebb5f8ef733803ee50bfd4e63ad1 (diff)
downloadphp-git-0a351335249697ef3fe0b2f9441cf30ad5cb8499.tar.gz
- Fixed bug #53241 (stream casting that relies on fdopen/fopencookie fails
with streams opened with, inter alia, the 'xb' mode).
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-xmain/php_streams.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/php_streams.h b/main/php_streams.h
index 99a75473f4..2ac8151b53 100755
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -462,6 +462,12 @@ END_EXTERN_C()
#define PHP_STREAM_CAST_MASK (PHP_STREAM_CAST_TRY_HARD | PHP_STREAM_CAST_RELEASE | PHP_STREAM_CAST_INTERNAL)
BEGIN_EXTERN_C()
PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC);
+/* This functions transforms the first char to 'w' if it's not 'r', 'a' or 'w'
+ * and strips any subsequent chars except '+' and 'b'.
+ * Use this to sanitize stream->mode if you call e.g. fdopen, fopencookie or
+ * any other function that expects standard modes and you allow non-standard
+ * ones. result should be a char[5]. */
+PHPAPI void php_stream_rep_nonstand_mode(php_stream *stream, char *result);
END_EXTERN_C()
/* use this to check if a stream can be cast into another form */
#define php_stream_can_cast(stream, as) _php_stream_cast((stream), (as), NULL, 0 TSRMLS_CC)