Update tablewiz.php

This commit is contained in:
Namhyeon Go 2018-02-26 14:12:37 +09:00 committed by GitHub
parent 5947c1be7e
commit c0b1701bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,9 +8,11 @@
if(!function_exists("tablewiz_cut_str")) { if(!function_exists("tablewiz_cut_str")) {
function tablewiz_cut_str($str, $strlimit=0) { function tablewiz_cut_str($str, $strlimit=0) {
if($strlimit > 0) { $plaintext = strip_tags($str);
// do not use html tag when use cut_str
$str = substr(strip_tags($str), 0, $strlimit); // if use html, do not cut text
if($strlimit > 0 && $str != $plaintext) {
$str = substr($str, 0, $strlimit);
} }
return $str; return $str;