]> granicus.if.org Git - php/commitdiff
- Fixed bug #23661: mysql_fetch_array gives no warning on an invalid
authorDerick Rethans <derick@php.net>
Fri, 16 May 2003 19:07:57 +0000 (19:07 +0000)
committerDerick Rethans <derick@php.net>
Fri, 16 May 2003 19:07:57 +0000 (19:07 +0000)
  result_type

NEWS
ext/mysql/php_mysql.c

diff --git a/NEWS b/NEWS
index b81f537e202a3ecf27a07ae6ff35e8ba87675470..2abff4e8e9f24d28bf2df0fc4a1cd7177441b814 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -41,6 +41,8 @@ PHP 4                                                                      NEWS
 - Fixed several 64-bit problems. (Dave)
 - Fixed several errors in hwapi extension. Objects weren't handled properly.
   (Uwe)
+- Fixed bug #23661 (mysql_fetch_array give no warning when an invalid argument
+  was passed as result_type). (Derick)
 - Fixed bug #23606 (Unable to build --with-db4 (db4.1.25)). (Marcus)
 - Fixed bug #23567 (pfsockopen() returns dead connections). (Wez)
 - Fixed bug #23527 (PostScript Type 1 fonts do not render properly).
index 1e7ba432b9522abd65ff2382e89cc038bdf46f25..2d766c4dcc2f41346d5a4fae3f82c4a710cee26a 100644 (file)
@@ -1876,6 +1876,10 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
                        WRONG_PARAM_COUNT;
                        break;
        }
+
+       if ((result_type & MYSQL_BOTH) == 0) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH.");
+       }
        
        ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);