X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=showmore%2Fshowmore.php;h=9a136c7f23eb319c183cbfd1c869493444896912;hb=bbc8a1328dbb7168f42c605325c1aee31b15a5cf;hp=5b0f14a0c38fe39c7ecf954bde8a03bcad34acd1;hpb=7f34be5a9a2e32fa9622c5d4b8836142b69a8916;p=friendica-addons.git diff --git a/showmore/showmore.php b/showmore/showmore.php index 5b0f14a0..9a136c7f 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,8 +75,15 @@ 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) - $dom = DomDocument::loadHTML($body); + + // Get rid of the warning. It would be better to have some valid html as input + $dom = @DomDocument::loadHTML($body); $xpath = new DOMXPath($dom); /*