]> granicus.if.org Git - php/commitdiff
- MFH: Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick)
authorDerick Rethans <derick@php.net>
Fri, 4 Feb 2005 14:29:05 +0000 (14:29 +0000)
committerDerick Rethans <derick@php.net>
Fri, 4 Feb 2005 14:29:05 +0000 (14:29 +0000)
NEWS
ext/dbase/dbase.c

diff --git a/NEWS b/NEWS
index 26062dd6048862b664bc3789cad1b78fabaa44e2..e97a70b47204cc00b69f172888059b29f861cfd5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,7 @@ PHP                                                                        NEWS
 - Fixed bug #31796 (readline completion handler does not handle empty return
   values). (Ilia)
 - Fixed bug #31755 (Cannot create SOAP header in no namespace). (Dmitry)
+- Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick)
 - Fixed bug #31747 (SOAP Digest Authentication doesn't work with 
   "HTTP/1.1 100 Continue" response). (Dmitry)
 - Fixed bug #31732 (mb_get_info() causes segfault when no parameters 
index 5bb109de84e0d8e38a06af31192ebf77f385a2f5..15d9f4f00ea2a51613a4a7ebe2cd1b36f69b605c 100644 (file)
@@ -129,6 +129,11 @@ PHP_FUNCTION(dbase_open)
        convert_to_string_ex(dbf_name);
        convert_to_long_ex(options);
 
+       if (Z_LVAL_PP(options) == 1) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open %s in write-only mode", Z_STRVAL_PP(dbf_name));
+               RETURN_FALSE;
+       }
+
        if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(dbf_name), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
                RETURN_FALSE;
        }