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;
$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;
$newlines = array();
$level = 0;
- foreach($lines as $line) {;
+ foreach ($lines as $line) {;
$line = trim($line);
$startquote = false;
while (strpos("*".$line, '[quote]') > 0) {
$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"));
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)
$message = str_replace("\r", "", $html);
- // replace all hashtag addresses
- if (get_config("system", "remove_hashtags_on_export")) {
- $pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
- $message = preg_replace($pattern, '#$2', $message);
- }
-
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
node2bbcode($doc, 'h6', array(), "\n\n*", "*\n");
// Problem: there is no reliable way to detect if it is a link to a tag or profile
- //node2bbcode($doc, 'a', array('href'=>'/(.+)/'), ' $1 ', '', true);
- node2bbcode($doc, 'a', array('href'=>'/(.+)/', 'rel'=>'oembed'), ' $1 ', '', true);
+ //node2bbcode($doc, 'a', array('href'=>'/(.+)/'), ' $1 ', ' ', true);
+ //node2bbcode($doc, 'a', array('href'=>'/(.+)/', 'rel'=>'oembed'), ' $1 ', '', true);
//node2bbcode($doc, 'img', array('alt'=>'/(.+)/'), '$1', '');
//node2bbcode($doc, 'img', array('title'=>'/(.+)/'), '$1', '');
//node2bbcode($doc, 'img', array(), '', '');
$message = html_entity_decode($message, ENT_QUOTES, 'UTF-8');
- if (!$compact AND ($message != "")) {
+ if (!$compact && ($message != "")) {
$counter = 1;
foreach ($urls as $id=>$url)
- if (strpos($message, $url) === false)
- $message .= "\n".$url." ";
- //$message .= "\n[".($counter++)."] ".$url;
+ if ($url != "")
+ if (strpos($message, $url) === false)
+ $message .= "\n".$url." ";
+ //$message .= "\n[".($counter++)."] ".$url;
}
$message = str_replace("\n«", "«\n", $message);
return(trim($message));
}
-