bug #2153970 [core] Properly truncate SQL to avoid half of html tags

This commit is contained in:
Michal Čihař
2008-10-09 09:41:22 +00:00
parent cd2a913960
commit 8924ab9d79
2 changed files with 3 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug #1914066 [core] ForceSSL generates incorrectly escaped redirections
(this time with the correct fix)
+ [lang] Hungarian update, thanks to Jozsef Tamas Herczeg - dodika
- bug #2153970 [core] Properly truncate SQL to avoid half of html tags
3.0.0.0 (2008-09-27)
+ [export] properly handle line breaks for YAML, thanks to Dan Barry -

View File

@@ -1022,7 +1022,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice')
// when the query is large (for example an INSERT of binary
// data), the parser chokes; so avoid parsing the query
$query_too_big = true;
$query_base = nl2br(htmlspecialchars($sql_query));
$shortened_query_base = nl2br(htmlspecialchars(substr($sql_query, 0, $cfg['MaxCharactersInDisplayedSQL']) . '[...]'));
} elseif (! empty($GLOBALS['parsed_sql'])
&& $query_base == $GLOBALS['parsed_sql']['raw']) {
// (here, use "! empty" because when deleting a bookmark,
@@ -1177,7 +1177,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice')
echo '<code class="sql">';
if ($query_too_big) {
echo substr($query_base, 0, $cfg['MaxCharactersInDisplayedSQL']) . '[...]';
echo $shortened_query_base;
} else {
echo $query_base;
}