Welcome Guest, Not a member yet? Register   Sign In
Auto detecting urls inside text - urls have some arabic letters
#4

(This post was last modified: 03-09-2017, 12:41 PM by ivantcholakov. Edit Reason: the second suggestion )

A quick modification without much thinking - see this line: https://github.com/bcit-ci/CodeIgniter/b...r.php#L396

Change it in the following way and make a test:

Code:
if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#ui', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))

If you are satisfied revert this change, make application/helpers/MY_url_helper.php file and put the whole modified function there.

Edit: You may try also the following modification:
Code:
if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i'.(UTF8_ENABLED ? 'u' : ''), $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))
Reply


Messages In This Thread
RE: Auto detecting urls inside text - urls have some arabic letters - by ivantcholakov - 03-09-2017, 12:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB