pingback fetchData: Retreive content from first <p> tag, if found in order to have the article content instead of menu structure as content. If no <p> tag is found, the <body> tag is the starting point to fetch content.
This commit is contained in:
parent
1e202312e6
commit
a2d9199fd9
@ -510,10 +510,16 @@ function fetchPingbackData( &$comment) {
|
||||
$comment['title'] = strip_tags($matches[1]);
|
||||
}
|
||||
|
||||
// Try to get content from first <p> tag on:
|
||||
if (preg_match('@<p[^>]*>(.*?)</body>@is',$fContent,$matches)) {
|
||||
$body = $matches[1];
|
||||
}
|
||||
if (empty($body) && preg_match('@<body[^>]*>(.*?)</body>@is',$fContent,$matches)){
|
||||
$body = $matches[1];
|
||||
}
|
||||
// Get a part of the article
|
||||
if (preg_match('@<body[^>]*>(.*?)</body>@is',$fContent,$matches)) {
|
||||
|
||||
$body = strip_tags($matches[1]);
|
||||
if (!empty($body)) {
|
||||
$body = strip_tags($body);
|
||||
|
||||
//TODO: Serendipity comes into trouble wit html_entity_decode and "Umlaute"
|
||||
$body = str_replace(array(" "),array(' '),$body);
|
||||
|
Loading…
x
Reference in New Issue
Block a user