Compare commits

..

No commits in common. "6d24cd01399035311428663bbccb339c54ed2e86" and "237539501bb56581d0936fe312f5a2c77073cb5e" have entirely different histories.

1 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,11 @@ class TelegramLinkFixerExtension extends Minz_Extension
} }
// First try: Look for Telegraph link with "Telegraph" text // First try: Look for Telegraph link with "Telegraph" text
if (preg_match('/href="(https:\/\/telegra\.ph\/[^"]+)"/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
else if (preg_match('/<p>.*?<a[^>]*?href="(https:\/\/telegra\.ph\/[^"]+)"[^>]*>/i', $description, $matches)) {
$telegraphLink = $matches[1]; $telegraphLink = $matches[1];
} }