From 5ea6683d0e80ef4022c6509dcf6b1ad206b0c859 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 11 Jan 2011 07:53:30 -0500 Subject: [PATCH] Avoid notice for undefined global --- db_operations.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/db_operations.php b/db_operations.php index 36b479c2d..94120d96f 100644 --- a/db_operations.php +++ b/db_operations.php @@ -196,7 +196,9 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { if (! $_error) { // temporarily force to add DROP IF EXIST to CREATE VIEW query, // to remove stand-in VIEW that was created earlier - $temp_drop_if_exists = $GLOBALS['drop_if_exists']; + if (isset($GLOBALS['drop_if_exists'])) { + $temp_drop_if_exists = $GLOBALS['drop_if_exists']; + } $GLOBALS['drop_if_exists'] = 'true'; foreach ($views as $view) { @@ -205,8 +207,12 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { break; } } - // restore previous value - $GLOBALS['drop_if_exists'] = $temp_drop_if_exists; + unset($GLOBALS['drop_if_exists']); + if (isset($temp_drop_if_exists)) { + // restore previous value + $GLOBALS['drop_if_exists'] = $temp_drop_if_exists; + unset($temp_drop_if_exists); + } } unset($view, $views); -- 2.11.4.GIT