summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2003-05-16 19:07:57 +0000
committerDerick Rethans <derick@php.net>2003-05-16 19:07:57 +0000
commit37142b284f7422dce8fd818b25b46af76397ca36 (patch)
tree52cddb2a1b899e9c80a714c283518f8326b1eeac
parent217a213a5d19a8885ad43043f855124f3213f751 (diff)
downloadphp-git-37142b284f7422dce8fd818b25b46af76397ca36.tar.gz
- Fixed bug #23661: mysql_fetch_array gives no warning on an invalid
result_type
-rw-r--r--NEWS2
-rw-r--r--ext/mysql/php_mysql.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index b81f537e20..2abff4e8e9 100644
--- 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).
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 1e7ba432b9..2d766c4dcc 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -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);