Avoid notice for undefined global

This commit is contained in:
Marc Delisle
2011-01-11 07:53:30 -05:00
parent 54a37aee2d
commit 5ea6683d0e

View File

@@ -196,7 +196,9 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
if (! $_error) { if (! $_error) {
// temporarily force to add DROP IF EXIST to CREATE VIEW query, // temporarily force to add DROP IF EXIST to CREATE VIEW query,
// to remove stand-in VIEW that was created earlier // to remove stand-in VIEW that was created earlier
if (isset($GLOBALS['drop_if_exists'])) {
$temp_drop_if_exists = $GLOBALS['drop_if_exists']; $temp_drop_if_exists = $GLOBALS['drop_if_exists'];
}
$GLOBALS['drop_if_exists'] = 'true'; $GLOBALS['drop_if_exists'] = 'true';
foreach ($views as $view) { foreach ($views as $view) {
@@ -205,8 +207,12 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
break; break;
} }
} }
unset($GLOBALS['drop_if_exists']);
if (isset($temp_drop_if_exists)) {
// restore previous value // restore previous value
$GLOBALS['drop_if_exists'] = $temp_drop_if_exists; $GLOBALS['drop_if_exists'] = $temp_drop_if_exists;
unset($temp_drop_if_exists);
}
} }
unset($view, $views); unset($view, $views);