This project is read-only.

Problem With ResloveLinks Extension Regex

Topics: Controls
Feb 5, 2008 at 11:43 PM
Edited Feb 5, 2008 at 11:57 PM
I noticed that a url in one of the comments on my blog broke the regex used to identify Urls in the ResolveLinks extension. The problem was that the regex used by the ResolveLinks does not allow the plus symbol + to be in the url string. In order to fix the problem, i just added the + to the list of accepted characters. So Line 26 in ResolveLinks goes from:

private static readonly Regex regex = new Regex("((http://|https://|www\\.)([A-Z0-9.\\-]{1,})\\.[0-9A-Z?;~&#=\\-_\\./]{2,})",
    RegexOptions.Compiled | RegexOptions.IgnoreCase);

private static readonly Regex regex = new Regex("((http://|https://|www\\.)([A-Z0-9.\\-]{1,})\\.[0-9A-Z?;~&#=\\-_\\./\\+]{2,})",
    RegexOptions.Compiled | RegexOptions.IgnoreCase);
I am not sure the best way to submit this change so I figured I would just post it here in case one of the contributors would like to submit the change into the code base.

Thanks again for all the great work you guys are doing.