diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 992315db..c10c62fc 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -641,7 +641,7 @@ class Adminer { $history[$_GET["db"]] = array(); } if (strlen($query) > 1e6) { - $query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment + $query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n…"; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment } $history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"] $sql_id = "sql-" . count($history[$_GET["db"]]); diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 1cfdeaac..02fa0e52 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -815,7 +815,7 @@ function shorten_utf8($string, $length = 80, $suffix = "") { if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{10FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match); } - return h($match[1]) . $suffix . (isset($match[2]) ? "" : "..."); + return h($match[1]) . $suffix . (isset($match[2]) ? "" : ""); } /** Format decimal number @@ -1476,7 +1476,7 @@ function edit_form($TABLE, $fields, $row, $update) { ? lang('Save and continue edit') : lang('Save and insert next') ) . "' title='Ctrl+Shift+Enter'>\n"; - echo ($update ? script("qsl('input').onclick = function () { return !ajaxForm(this.form, '" . lang('Saving') . "...', this); };") : ""); + echo ($update ? script("qsl('input').onclick = function () { return !ajaxForm(this.form, '" . lang('Saving') . "…', this); };") : ""); } } echo ($update ? "" . confirm() . "\n" diff --git a/adminer/select.inc.php b/adminer/select.inc.php index a87bc85e..403e0453 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -440,7 +440,7 @@ if (!$columns && support("table")) { $h_value = h($value !== null ? $value : $row[$key]); echo "" . ($text ? "" : ""); } else { - $long = strpos($val, "..."); + $long = strpos($val, ""); echo "$val" @@ -484,7 +484,7 @@ if (!$columns && support("table")) { if ($pagination) { echo (($found_rows === false ? count($rows) + 1 : $found_rows - $page * $limit) > $limit ? '

' . lang('Load more data') . '' - . script("qsl('a').onclick = partial(selectLoadMore, " . (+$limit) . ", '" . lang('Loading') . "...');", "") + . script("qsl('a').onclick = partial(selectLoadMore, " . (+$limit) . ", '" . lang('Loading') . "…');", "") : '' ); echo "\n"; @@ -503,12 +503,12 @@ if (!$columns && support("table")) { if ($jush != "simpledb") { echo "" . lang('Page') . ""; echo script("qsl('a').onclick = function () { pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "')); return false; };"); - echo pagination(0, $page) . ($page > 5 ? " ..." : ""); + echo pagination(0, $page) . ($page > 5 ? " …" : ""); for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) { echo pagination($i, $page); } if ($max_page > 0) { - echo ($page + 5 < $max_page ? " ..." : ""); + echo ($page + 5 < $max_page ? " …" : ""); echo ($exact_count && $found_rows !== false ? pagination($max_page, $page) : " " . lang('last') . "" @@ -516,9 +516,9 @@ if (!$columns && support("table")) { } } else { echo "" . lang('Page') . ""; - echo pagination(0, $page) . ($page > 1 ? " ..." : ""); + echo pagination(0, $page) . ($page > 1 ? " …" : ""); echo ($page ? pagination($page, $page) : ""); - echo ($max_page > $page ? pagination($page + 1, $page) . ($max_page > $page + 1 ? " ..." : "") : ""); + echo ($max_page > $page ? pagination($page + 1, $page) . ($max_page > $page + 1 ? " …" : "") : ""); } echo "\n"; } diff --git a/plugins/tinymce.php b/plugins/tinymce.php index 51f1216e..44ee37f5 100644 --- a/plugins/tinymce.php +++ b/plugins/tinymce.php @@ -40,14 +40,16 @@ tinyMCE.init({ function selectVal(&$val, $link, $field, $original) { if (preg_match("~_html~", $field["field"]) && $val != '') { - $shortened = (substr($val, -10) == "..."); + $ellipsis = ""; + $length = strlen($ellipsis); + $shortened = (substr($val, -$length) == $ellipsis); if ($shortened) { - $val = substr($val, 0, -10); + $val = substr($val, 0, -$length); } //! shorten with regard to HTML tags - http://php.vrana.cz/zkraceni-textu-s-xhtml-znackami.php $val = preg_replace('~<[^>]*$~', '', html_entity_decode($val, ENT_QUOTES)); // remove ending incomplete tag (text can be shortened) if ($shortened) { - $val .= "..."; + $val .= $ellipsis; } if (class_exists('DOMDocument')) { // close all opened tags $dom = new DOMDocument; diff --git a/plugins/wymeditor.php b/plugins/wymeditor.php index fcf06722..ca452bcb 100644 --- a/plugins/wymeditor.php +++ b/plugins/wymeditor.php @@ -29,14 +29,16 @@ class AdminerWymeditor { function selectVal(&$val, $link, $field, $original) { // copied from tinymce.php if (preg_match("~_html~", $field["field"]) && $val != '') { - $shortened = (substr($val, -10) == "..."); + $ellipsis = ""; + $length = strlen($ellipsis); + $shortened = (substr($val, -$length) == $ellipsis); if ($shortened) { - $val = substr($val, 0, -10); + $val = substr($val, 0, -$length); } //! shorten with regard to HTML tags - http://php.vrana.cz/zkraceni-textu-s-xhtml-znackami.php $val = preg_replace('~<[^>]*$~', '', html_entity_decode($val, ENT_QUOTES)); // remove ending incomplete tag (text can be shortened) if ($shortened) { - $val .= "..."; + $val .= $ellipsis; } if (class_exists('DOMDocument')) { // close all opened tags $dom = new DOMDocument;