From c55755d0ca9cb58371f9d6f667aa3dc4be984400 Mon Sep 17 00:00:00 2001 From: Andy Baugh Date: Mon, 6 Aug 2018 09:47:38 -0500 Subject: [PATCH] Fix merge conflicts in QA_4_8 from this pull request Signed-off-by: Isaac Bennetch Fix bad callers to getError where null was being passed. Fixes #14552: Considering how function signatures work in PHP, this should be a reltatively 'safe' change, as the mysqli lib currently would still do a check for cases where the passed in $link was either null or false. Otherwise the bug's source appears to be a common mistake in PHP: null != undefined Signed-off-by: Andy Baugh --- libraries/classes/Rte/Events.php | 6 +++--- libraries/classes/Rte/General.php | 2 +- libraries/classes/Rte/Routines.php | 8 ++++---- libraries/classes/Rte/Triggers.php | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/classes/Rte/Events.php b/libraries/classes/Rte/Events.php index c47ca5f104..3f10c638c2 100644 --- a/libraries/classes/Rte/Events.php +++ b/libraries/classes/Rte/Events.php @@ -123,7 +123,7 @@ class Events htmlspecialchars($drop_item) ) . '
' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); } else { $result = $GLOBALS['dbi']->tryQuery($item_query); if (! $result) { @@ -132,7 +132,7 @@ class Events htmlspecialchars($item_query) ) . '
' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); // We dropped the old item, but were unable to create // the new one. Try to restore the backup query $result = $GLOBALS['dbi']->tryQuery($create_item); @@ -163,7 +163,7 @@ class Events htmlspecialchars($item_query) ) . '

' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); } else { $message = Message::success( __('Event %1$s has been created.') diff --git a/libraries/classes/Rte/General.php b/libraries/classes/Rte/General.php index ffd05c0bf8..9b13380dc6 100644 --- a/libraries/classes/Rte/General.php +++ b/libraries/classes/Rte/General.php @@ -45,7 +45,7 @@ class General $errors[] = $error . '
' . __('The backed up query was:') . "\"" . htmlspecialchars($createStatement) . "\"" . '
' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); return $errors; } diff --git a/libraries/classes/Rte/Routines.php b/libraries/classes/Rte/Routines.php index 62ef51cfa7..3bfca689de 100644 --- a/libraries/classes/Rte/Routines.php +++ b/libraries/classes/Rte/Routines.php @@ -241,7 +241,7 @@ class Routines htmlspecialchars($drop_routine) ) . '
' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); } else { list($newErrors, $message) = self::create( $routine_query, @@ -268,7 +268,7 @@ class Routines htmlspecialchars($routine_query) ) . '

' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); } else { $message = Message::success( __('Routine %1$s has been created.') @@ -382,7 +382,7 @@ class Routines htmlspecialchars($routine_query) ) . '
' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); // We dropped the old routine, // but were unable to create the new one // Try to restore the backup query @@ -1495,7 +1495,7 @@ class Routines htmlspecialchars($multiple_query) ) . '

' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null) + . __('MySQL said: ') . $GLOBALS['dbi']->getError() ); } diff --git a/libraries/classes/Rte/Triggers.php b/libraries/classes/Rte/Triggers.php index 2edd2806bf..7f025affd1 100644 --- a/libraries/classes/Rte/Triggers.php +++ b/libraries/classes/Rte/Triggers.php @@ -98,7 +98,7 @@ class Triggers htmlspecialchars($drop_item) ) . '
' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); } else { $result = $GLOBALS['dbi']->tryQuery($item_query); if (! $result) { @@ -107,7 +107,7 @@ class Triggers htmlspecialchars($item_query) ) . '
' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); // We dropped the old item, but were unable to create the // new one. Try to restore the backup query. $result = $GLOBALS['dbi']->tryQuery($create_item); @@ -139,7 +139,7 @@ class Triggers htmlspecialchars($item_query) ) . '

' - . __('MySQL said: ') . $GLOBALS['dbi']->getError(null); + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); } else { $message = Message::success( __('Trigger %1$s has been created.')