php - Codeigniter Auto_link doesn't work bug -


I've got an HTML WYSIWYG editor for staff so that we can create a very basic text page on our website. & lt; Br> I use PHP's nl2br function to change the tag, but I have this problem:

If a user enters the string: This is a test link http://website.com

auto_link function works as expected, however, if I have it:

  This is a test link & lt; Br> Http: //website.com  

then the auto_link function does not work.

I have narrowed down the fact that the website address needs a place before it, and it is Regex used in CI:

  # (^ | \ S | \ () ((http (s?): //) | (www \.)) (\ W ^ [^ \ s \) \ & lt;] +) #i  

I'm not the most fluent in regular expressions, but if I change the above expression to:

  # (^ | |) | \ s | \ () ((Http (s?): //) | (www \.)) (\ W + [^ \ s \) \ & lt;] +) #i  

(first Note | \> added to the capture Not), then it works fine, although I do not have enough expression to know that it will mess up this functionality.

It does not matter if a tag starts directly after the address, but it does not matter if there is no place before the address.

Any help, or information will be appreciated. / P>

thanks


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -