1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-04 15:47:32 +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:
Eugene Molotov
2023-07-22 17:00:12 +05:00
committed by GitHub
parent 39a8346c53
commit 38ca124de0

View File

@@ -448,7 +448,9 @@ class VkBridge extends BridgeAbstract
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) {
return 'untitled';
}