From b3e71ff8037f101cc6ace3dd1dc05ce6159869fd Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Tue, 13 Dec 2022 10:59:17 +0100 Subject: [PATCH] Short-circuit well-known example domains --- activitypub.php | 40 +++++++++++++++++++++++++++++++++++- includes/class-mention.php | 2 +- includes/class-webfinger.php | 2 +- tests/test-functions.php | 19 +++++++++++++++++ 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/activitypub.php b/activitypub.php index a483425..6c77a3b 100644 --- a/activitypub.php +++ b/activitypub.php @@ -22,7 +22,7 @@ function init() { \defined( 'ACTIVITYPUB_EXCERPT_LENGTH' ) || \define( 'ACTIVITYPUB_EXCERPT_LENGTH', 400 ); \defined( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS' ) || \define( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS', 3 ); \defined( 'ACTIVITYPUB_HASHTAGS_REGEXP' ) || \define( 'ACTIVITYPUB_HASHTAGS_REGEXP', '(?:(?<=\s)|(?<=

)|(?<=
)|^)#([A-Za-z0-9_]+)(?:(?=\s|[[:punct:]]|$))' ); - \defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:[A-Za-z0-9_-]+@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' ); + \defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9_-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' ); \defined( 'ACTIVITYPUB_ALLOWED_HTML' ) || \define( 'ACTIVITYPUB_ALLOWED_HTML', '