' . "\n"
- . htmlspecialchars($queryBase, ENT_COMPAT) . '
';
} else {
- $queryBase = self::formatSql($queryBase);
+ $queryBase = self::formatSql($sqlQuery, true);
}
// Prepares links that may be displayed to edit/explain the query
@@ -507,6 +492,7 @@ class Generator
// but only explain a SELECT (that has not been explained)
/* SQL-Parser-Analyzer */
$explainLink = '';
+ $queryTooBig = mb_strlen($sqlQuery) > $config->settings['MaxCharactersInDisplayedSQL'];
$isSelect = preg_match('@^SELECT[[:space:]]+@i', $sqlQuery);
if (! empty($config->settings['SQLQuery']['Explain']) && ! $queryTooBig) {
$explainParams = $urlParams;
@@ -1085,8 +1071,6 @@ class Generator
* @param bool $truncate truncate the query if it is too long
*
* @return string the formatted sql
- *
- * @global array $cfg the configuration array
*/
public static function formatSql(string $sqlQuery, bool $truncate = false): string
{