X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fhtml2plain.php;h=72185de3b5c9bea9eaf1c53f8371c23ba87f0aba;hb=0cd9db9cb7f4c96f597e37590a536eaae123238d;hp=dc2cb137c49358e986f513860c5dda7d8f2b049e;hpb=299c0122f651305017e89cb5cde90e9f628fb354;p=friendica.git diff --git a/include/html2plain.php b/include/html2plain.php index dc2cb137c4..72185de3b5 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -23,7 +23,7 @@ function breaklines($line, $level, $wraplength = 75) if ($pos == 0) $pos = strpos($line, ' '); - if (($pos > 0) and strlen($line) > $wraplen) { + if (($pos > 0) && strlen($line) > $wraplen) { $newline = trim(substr($line, 0, $pos)); if ($level > 0) $newline = str_repeat(">", $level).' '.$newline; @@ -32,7 +32,7 @@ function breaklines($line, $level, $wraplength = 75) $line = substr($line, $pos+1); } - } while ((strlen($line) > $wraplen) and !($oldline == $line)); + } while ((strlen($line) > $wraplen) && !($oldline == $line)); if ($level > 0) $line = str_repeat(">", $level).' '.$line; @@ -70,7 +70,7 @@ function quotelevel($message, $wraplength = 75) $line = substr($line, 0, $pos).substr($line, $pos+8); } - if (!$startquote or ($line != '')) + if (!$startquote || ($line != '')) $newlines[] = breaklines($line, $currlevel, $wraplength); } return(implode($newlines, "\n")); @@ -92,13 +92,13 @@ function collecturls($message) { if (strpos($treffer[1], $listitem) !== false) $ignore = true; - if ((strpos($treffer[1], "//twitter.com/") !== false) and (strpos($treffer[1], "/status/") !== false)) + if ((strpos($treffer[1], "//twitter.com/") !== false) && (strpos($treffer[1], "/status/") !== false)) $ignore = false; - if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/posts") !== false)) + if ((strpos($treffer[1], "//plus.google.com/") !== false) && (strpos($treffer[1], "/posts") !== false)) $ignore = false; - if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/photos") !== false)) + if ((strpos($treffer[1], "//plus.google.com/") !== false) && (strpos($treffer[1], "/photos") !== false)) $ignore = false; if (!$ignore) @@ -212,7 +212,7 @@ function html2plain($html, $wraplength = 75, $compact = false) $message = html_entity_decode($message, ENT_QUOTES, 'UTF-8'); - if (!$compact AND ($message != "")) { + if (!$compact && ($message != "")) { $counter = 1; foreach ($urls as $id=>$url) if ($url != "") @@ -233,4 +233,3 @@ function html2plain($html, $wraplength = 75, $compact = false) return(trim($message)); } -?>