mirror of
https://github.com/vrana/adminer.git
synced 2025-08-18 04:11:27 +02:00
Shorten binary strings
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1011 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -158,5 +158,5 @@ function dump_headers($identifier, $multi_table = false) {
|
||||
}
|
||||
|
||||
$dump_output = "<select name='output'>" . optionlist(array('text' => lang('open'), 'file' => lang('save'))) . "</select>";
|
||||
$dump_output = "<select name='output'>" . optionlist(array('sql' => lang('SQL'), 'csv' => lang('CSV'))) . "</select>";
|
||||
$dump_format = "<select name='format'>" . optionlist(array('sql' => lang('SQL'), 'csv' => lang('CSV'))) . "</select>";
|
||||
$max_packet = 1048576; // default, minimum is 1024
|
||||
|
@@ -254,7 +254,9 @@ function is_utf8($val) {
|
||||
}
|
||||
|
||||
function shorten_utf8($string, $length = 80, $suffix = "") {
|
||||
preg_match("~^((?:.|\n){0,$length})(.|\n)?~u", $string, $match); // ~s causes trash in $match[2] under some PHP versions
|
||||
if (!preg_match("~^((?:.|\n){0,$length})(.|\n)?~u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions
|
||||
preg_match("(^([\t\r\n -~]{0,$length})(.?))s", $string, $match);
|
||||
}
|
||||
return h($match[1]) . $suffix . ($match[2] ? "<em>...</em>" : "");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user