optimize the telegraph link extraction

This commit is contained in:
Tiger Ren 2025-01-02 10:10:41 +08:00
parent b93ea90af5
commit 237539501b
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ class TelegramLinkFixerExtension extends Minz_Extension
}
// First try: Look for Telegraph link with "Telegraph" text
if (preg_match('/<a[^>]*?href="(https:\/\/telegra\.ph\/[^"]+)"[^>]*>Telegraph<\/a>/i', $description, $matches)) {
if (preg_match('/href="(https:\/\/telegra\.ph\/[^"]+)"[^>]*>Telegraph</i', $description, $matches)) {
$telegraphLink = $matches[1];
}
// Second try: Look for any Telegraph link in the first paragraph