From: Tim Düsterhus Date: Thu, 7 Sep 2023 12:36:28 +0000 (+0200) Subject: Simplify consecutive repetition operators in FileUtil::LINK_REGEX X-Git-Tag: 6.0.0_RC_1~53^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e11bd6322ab42612b42fa9f709a6a2c6d67fe8b;p=GitHub%2FWoltLab%2FWCF.git Simplify consecutive repetition operators in FileUtil::LINK_REGEX This appeared with the previous commit and cause useless backtracking. --- diff --git a/wcfsetup/install/files/lib/util/FileUtil.class.php b/wcfsetup/install/files/lib/util/FileUtil.class.php index c1cba09eda..25347d55a8 100644 --- a/wcfsetup/install/files/lib/util/FileUtil.class.php +++ b/wcfsetup/install/files/lib/util/FileUtil.class.php @@ -35,7 +35,7 @@ final class FileUtil /** * A regular expression that allows to detect links within text. */ - public const LINK_REGEX = "#(?i)\\b((?:https?://|www\\d{0,3}[.]|(?:[a-z0-9\\-]+[.])+[a-z]{2,4}/)(?:[^\\s()<>]+|\\((?:[^\\s()<>]+)*\\))+(?:\\((?:[^\\s()<>]+)*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))#iS"; + public const LINK_REGEX = "#(?i)\\b((?:https?://|www\\d{0,3}[.]|(?:[a-z0-9\\-]+[.])+[a-z]{2,4}/)(?:[^\\s()<>]+|\\((?:[^\\s()<>])*\\))+(?:\\((?:[^\\s()<>])*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))#iS"; /** * Prepares the temporary folder and returns its path.