X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=showmore%2Fshowmore.php;h=a9d8334f3e41dea7532d2df1d11599cf95fb2a70;hb=abccb42ae6876c4a6f6bac4cee956a9dde49a6be;hp=096fd3f704b69e3f825daeffdc84048967e4beb0;hpb=47a5a5c03a78e829ece69912deb78ad3e3af235e;p=friendica-addons.git diff --git a/showmore/showmore.php b/showmore/showmore.php index 096fd3f7..a9d8334f 100755 --- a/showmore/showmore.php +++ b/showmore/showmore.php @@ -34,8 +34,14 @@ function showmore_addon_settings(&$a,&$s) { if(!$chars) $chars = '1100'; - $s .= '
'; + $s .= ''; $s .= '

' . t('"Show more" Settings').'

'; + $s .= '
'; + $s .= ''; @@ -69,6 +75,11 @@ function showmore_addon_settings_post(&$a,&$b) { function get_body_length($body) { $string = trim($body); + // DomDocument doesn't like empty strings + if(! strlen($string)) { + return 0; + } + // We need to get rid of hidden tags (display: none) // Get rid of the warning. It would be better to have some valid html as input @@ -110,9 +121,9 @@ function showmore_prepare_body(&$a,&$b) { if($found) { $rnd = random_string(8); - $b['html'] = ''.$shortened." ". - ''.sprintf(t('show more')).''. - ''; + $b['html'] = ''.$shortened." ". + ''.sprintf(t('show more')).''. + ''; } }