vp#404 Improve URL filter

master
Andrey Kleshchev 2025-03-21 21:40:38 +02:00 committed by Andrey Kleshchev
parent bf0767b0d7
commit ecfe76ac12
1 changed files with 10 additions and 0 deletions

View File

@ -221,6 +221,16 @@ bool LLUrlEntryBase::isWikiLinkCorrect(const std::string &labeled_url) const
},
L'\u002F'); // Solidus
std::replace_if(wlabel.begin(),
wlabel.end(),
[](const llwchar& chr)
{
return // Not a decomposition, but suficiently similar
(chr == L'\u04BA') // "Cyrillic Capital Letter Shha"
|| (chr == L'\u04BB'); // "Cyrillic Small Letter Shha"
},
L'\u0068'); // "Latin Small Letter H"
std::string label = wstring_to_utf8str(wlabel);
if ((label.find(".com") != std::string::npos
|| label.find("www.") != std::string::npos)