mirror of
https://github.com/vrana/adminer.git
synced 2026-04-12 15:38:28 +02:00
Change '...' to horizontal ellipsis character
This commit is contained in:
@@ -40,14 +40,16 @@ tinyMCE.init({
|
||||
|
||||
function selectVal(&$val, $link, $field, $original) {
|
||||
if (preg_match("~_html~", $field["field"]) && $val != '') {
|
||||
$shortened = (substr($val, -10) == "<i>...</i>");
|
||||
$ellipsis = "<i>…</i>";
|
||||
$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 .= "<i>...</i>";
|
||||
$val .= $ellipsis;
|
||||
}
|
||||
if (class_exists('DOMDocument')) { // close all opened tags
|
||||
$dom = new DOMDocument;
|
||||
|
||||
Reference in New Issue
Block a user