Fix unwanted detection of URLs
authorMarcel Werk <burntime@woltlab.com>
Mon, 19 Feb 2024 16:54:43 +0000 (17:54 +0100)
committerMarcel Werk <burntime@woltlab.com>
Mon, 19 Feb 2024 16:54:43 +0000 (17:54 +0100)
ref https://www.woltlab.com/community/thread/304475-unerwartete-umwandlung-in-einen-link/

wcfsetup/install/files/lib/util/FileUtil.class.php

index c0a759c2e26e6f9054a0c87463be4d7bfb2ecd2e..e7a86de3e55f311adb911bbac94069c015832435 100644 (file)
@@ -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}[.])(?:[^\\s()<>\\[\\]]+|\\([^\\s()<>\\[\\]]*\\))+(?:\\([^\\s()<>\\[\\]]*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))#iS";
 
     /**
      * Prepares the temporary folder and returns its path.