diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index 6d5d952c7..5d0a8224e 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -871,10 +871,9 @@ abstract class EchoDiscussionParser { */ static function getTimestampPosition( $line ) { $timestampRegex = self::getTimestampRegex(); - $endOfLine = self::getLineEndingRegex(); $tsMatches = []; if ( !preg_match( - "/$timestampRegex$endOfLine/mu", + "/$timestampRegex/mu", $line, $tsMatches, PREG_OFFSET_CAPTURE @@ -1121,26 +1120,6 @@ abstract class EchoDiscussionParser { return User::getCanonicalName( $userMatches[0], false ); } - /** - * Gets a regular expression fragmentmatching characters that - * can appear in a line after the signature. - * - * @return string regular expression fragment. - */ - static function getLineEndingRegex() { - $ignoredEndings = [ - '\s*', - preg_quote( '}' ), - preg_quote( '{' ), - '\<[^\>]+\>', - preg_quote( '{{' ) . '[^}]+' . preg_quote( '}}' ), - ]; - - $regex = '(?:' . implode( '|', $ignoredEndings ) . ')*'; - - return $regex; - } - /** * Gets a regular expression that will match this wiki's * timestamps as given by ~~~~.