From: Brion Vibber Date: Tue, 20 Nov 2007 21:21:39 +0000 (+0000) Subject: Cleanup vis-a-vis r27691 X-Git-Tag: 1.31.0-rc.0~50769 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=a6101521a245f750d91509fea75dcf4fc0b4572f;p=lhc%2Fweb%2Fwiklou.git Cleanup vis-a-vis r27691 Use x option on regex so we can break it up for legibility. PHP doesn't seem to let you concat multiple strings in a constant definition, which is kind of lame, so this seems to be the cleanest way to break it over lines. :P --- diff --git a/includes/Parser.php b/includes/Parser.php index 0751d9bffa..2de8f9c7e4 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -58,7 +58,8 @@ class Parser # Constants needed for external link processing # Everything except bracket, space, or control characters const EXT_LINK_URL_CLASS = '[^][<>"\\x00-\\x20\\x7F]'; - const EXT_IMAGE_REGEX = '/^(http:\/\/|https:\/\/)([^][<>"\\x00-\\x20\\x7F]+)\\/([A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]+)\\.((?i)gif|png|jpg|jpeg)$/S'; + const EXT_IMAGE_REGEX = '/^(http:\/\/|https:\/\/)([^][<>"\\x00-\\x20\\x7F]+) + \\/([A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]+)\\.((?i)gif|png|jpg|jpeg)$/Sx'; // State constants for the definition list colon extraction const COLON_STATE_TEXT = 0;