From 1c1fbde5f55008b4a61ba0e623384d6d7bbda609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 9 Oct 2008 09:41:22 +0000 Subject: [PATCH] bug #2153970 [core] Properly truncate SQL to avoid half of html tags --- ChangeLog | 1 + libraries/common.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2a272e17..e8cc623aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,6 +39,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 - diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 7aa987b75..5c31d9782 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1052,7 +1052,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, @@ -1207,7 +1207,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice') echo ''; if ($query_too_big) { - echo substr($query_base, 0, $cfg['MaxCharactersInDisplayedSQL']) . '[...]'; + echo $shortened_query_base; } else { echo $query_base; }