From ac431071871b47998180d69cc08314bfd9861d8c Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Thu, 30 Jun 2016 15:39:15 -0700 Subject: [PATCH] Avoid warnings due to unmatched capture groups If the non-capturing group which contains the last two capture groups of the expression is not matched, the indexes are not defined in the match result, causing a warning. Avoid this using isset() before access. Signed-off-by: Kevin Locke --- pg4wp/driver_pgsql_install.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pg4wp/driver_pgsql_install.php b/pg4wp/driver_pgsql_install.php index 695d353..f03c257 100644 --- a/pg4wp/driver_pgsql_install.php +++ b/pg4wp/driver_pgsql_install.php @@ -57,8 +57,8 @@ $logto = 'SHOWCOLUMN'; $full = $matches[1]; $table = $matches[2]; - $like = $matches[3]; - $where = $matches[4]; + $like = isset($matches[3]) ? $matches[3] : FALSE; + $where = isset($matches[4]) ? $matches[4] : FALSE; // Wrap as sub-query to emulate WHERE behavior $sql = ($where ? 'SELECT * FROM (' : ''). 'SELECT column_name as "Field",