From 145bd10f4c00f3aef9d178266cb3282920dc6f41 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Wed, 11 Oct 2023 21:16:57 +0500 Subject: [PATCH] [VkBridge] Revert more universal regex for title generation (#3736) In practice it lead to feed items to have "untitled". Using previous regex with more covered cases. Credits to https://t.me/votkot as author of regex --- bridges/VkBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php index 90b2586e..a21ee665 100644 --- a/bridges/VkBridge.php +++ b/bridges/VkBridge.php @@ -453,7 +453,7 @@ class VkBridge extends BridgeAbstract { $content = explode('
', $content)[0]; $content = strip_tags($content); - preg_match('/.+?(?=[\.\n])/mu', htmlspecialchars_decode($content), $result); + preg_match('/^[:\,"\w\ \p{L}\(\)\?#«»\-\–\—||&\.%\\₽\/+\;\!]+/mu', htmlspecialchars_decode($content), $result); if (count($result) == 0) { return 'untitled'; }