Skip to content

Commit

Permalink
Fix Post special char regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed May 29, 2012
1 parent c835bc4 commit 2e931bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webapp/_lib/model/class.Post.php
Expand Up @@ -262,7 +262,7 @@ public static function extractURLs($post_text) {
$url_pattern = '(?i)\b'.
'((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)'.
'(?:[^\s()<>/][^\s()<>]*|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+'.
'(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’,�]))';
'(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’,Ó]))';
preg_match_all('#'.$url_pattern.'#', $post_text, $matches);
$corrected_urls = array_map( 'Link::addMissingHttp', $matches[0]);
return array_filter($corrected_urls,'Utils::validateURL');
Expand Down

0 comments on commit 2e931bd

Please sign in to comment.