From e6182b81b49cb3bbe41a976d55ff870de0260d7e Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 13 Nov 2017 13:06:13 +0100 Subject: [PATCH] getRegexFromLink no longer matches links to anchors (e.g. comments/responses) --- .../AbstractHtmlInputNodeProcessorListener.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php b/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php index 162ac26d90..b23243851c 100644 --- a/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php @@ -46,10 +46,11 @@ abstract class AbstractHtmlInputNodeProcessorListener implements IParameterizedE * followed by an object id. * * @param string $link + * @param string $defaultAnchor * @return Regex */ - protected function getRegexFromLink($link) { - return new Regex('^(' . preg_replace('~^https?~', 'https?', preg_quote($link)) . '(\d+)-.*?)$'); + protected function getRegexFromLink($link, $defaultAnchor = '') { + return new Regex('^(' . preg_replace('~^https?~', 'https?', preg_quote($link)) . '(\d+)-[^#]*?)' . ($defaultAnchor ? '(?:#' . $defaultAnchor . ')?' : '') . '$'); } /** -- 2.20.1