From: x2001corpet Date: Sat, 21 Oct 2006 13:06:41 +0000 (+0000) Subject: oops X-Git-Tag: xorg/0.9.12~189 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6146ec8e28691fb4df15d5a957c883924c5b9f98;p=platal.git oops git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@997 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/include/url_catcher.inc.php b/include/url_catcher.inc.php new file mode 100644 index 0000000..b1dd3f8 --- /dev/null +++ b/include/url_catcher.inc.php @@ -0,0 +1,24 @@ +\\0'; + + // url commencant par www. + $patterns[] = '/(\s|^)www\.((?:\.*,*[a-z@0-9~%$£µ&i#\-+=_\/\?])*)/i'; + $replacement[] = '\\1www.\\2'; + + if ($mails) { + $patterns[] = '/(?:mailto:)?([a-z0-9.\-+_]+@([\-.+_]?[a-z0-9])+)/i'; + $replacement[] = '\\0'; + } + + return preg_replace($patterns, $replacement, $texte); +} +?>