Better rule to replace content
This commit is contained in:
parent
7c658439da
commit
9c5cd476dd
1 changed files with 14 additions and 1 deletions
|
@ -353,7 +353,20 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
|
|||
}
|
||||
}
|
||||
|
||||
if (strlen($item["title"]) > strlen($item["body"])) {
|
||||
// Replace the content when the title is longer than the body
|
||||
$replace = (strlen($item["title"]) > strlen($item["body"]));
|
||||
|
||||
// Replace it, when there is an image in the body
|
||||
if (strstr($item["body"], '[/img]')) {
|
||||
$replace = true;
|
||||
}
|
||||
|
||||
// Replace it, when there is a link in the body
|
||||
if (strstr($item["body"], '[/url]')) {
|
||||
$replace = true;
|
||||
}
|
||||
|
||||
if ($replace) {
|
||||
$item["body"] = $item["title"];
|
||||
$item["title"] = "";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue