Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Shorten binary strings

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1011 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit 95764b012538df50f892a0164672d8635aced5fe 1 parent e4f5d17
jakubvrana authored
View
2  adminer/include/export.inc.php
@@ -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
View
4 adminer/include/functions.inc.php
@@ -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>" : "");
}
Please sign in to comment.
Something went wrong with that request. Please try again.