Compare commits

...

2 Commits

Author SHA1 Message Date
Tiger Ren 6d24cd0139 Merge branch 'main' of http://192.168.2.212:3000/xorbitlab/xExtensionTGLinkFixer
# Conflicts:
#	extension.php
2025-01-02 23:02:35 +08:00
Tiger Ren 592b7c8fb6 change url extraction reg 2025-01-02 23:01:42 +08:00
1 changed files with 1 additions and 5 deletions

View File

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