summaryrefslogtreecommitdiffstats
path: root/lib/mysql.php
diff options
context:
space:
mode:
authorDavey Shafik <davey@php.net>2020-10-27 10:18:04 +0000
committerGitHub <noreply@github.com>2020-10-27 10:18:04 +0000
commit8498f6410e7608b623ba2a6030726e5391dd7f4b (patch)
treef6d22d5d9f0bf3a5732ffcc7b91100b6588b3ec9 /lib/mysql.php
parente639fd80b4a2328d1b4f0429ee302ae915a99c71 (diff)
downloadphp7-mysql-shim-8498f6410e7608b623ba2a6030726e5391dd7f4b.zip
php7-mysql-shim-8498f6410e7608b623ba2a6030726e5391dd7f4b.tar.gz
php7-mysql-shim-8498f6410e7608b623ba2a6030726e5391dd7f4b.tar.bz2
Add missing warning from mysql_fetch_field()
Diffstat (limited to 'lib/mysql.php')
-rw-r--r--lib/mysql.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index 7f6f008..909fdec 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -419,6 +419,10 @@ namespace {
// @codeCoverageIgnoreEnd
}
$res = mysqli_fetch_field($result);
+ if ($res === false) {
+ trigger_error('mysql_fetch_field(): Bad field offset', E_USER_WARNING);
+ }
+
if ($res instanceof \stdClass) {
$res->not_null = ($res->flags & MYSQLI_NOT_NULL_FLAG) ? 1 : 0;
$res->primary_key = ($res->flags & MYSQLI_PRI_KEY_FLAG ) ? 1 : 0;