mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-09 20:34:35 +02:00
[VkBridge] Better title generation (#3563)
1. Use first parargraph only 2. Remove tags 3. Allow to use comma and colon in title
This commit is contained in:
parent
39a8346c53
commit
38ca124de0
1 changed files with 3 additions and 1 deletions
|
@ -448,7 +448,9 @@ class VkBridge extends BridgeAbstract
|
||||||
|
|
||||||
private function getTitle($content)
|
private function getTitle($content)
|
||||||
{
|
{
|
||||||
preg_match('/^["\w\ \p{L}\(\)\?#«»-]+/mu', htmlspecialchars_decode($content), $result);
|
$content = explode('<br>', $content)[0];
|
||||||
|
$content = strip_tags($content);
|
||||||
|
preg_match('/^[:,"\w\ \p{L}\(\)\?#«»-]+/mu', htmlspecialchars_decode($content), $result);
|
||||||
if (count($result) == 0) {
|
if (count($result) == 0) {
|
||||||
return 'untitled';
|
return 'untitled';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue