change url extraction reg
This commit is contained in:
parent
b93ea90af5
commit
592b7c8fb6
|
|
@ -41,11 +41,7 @@ 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('/<a[^>]*?href="(https:\/\/telegra\.ph\/[^"]+)"[^>]*>Telegraph<\/a>/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];
|
$telegraphLink = $matches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue