XOOPS Cube Legacy base repository
Revision | 1e344a1b777fe54bbd9d25407c803ca3f9418c35 (tree) |
---|---|
Zeit | 2011-11-05 13:45:59 |
Autor | nbuy <nbuy@704c...> |
Commiter | nbuy |
fix URI string accept class define RFC 1738
git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1036 704cf05f-ae62-4b0e-a484-234ee0250e75
@@ -254,11 +254,13 @@ class Legacy_TextFilter extends XCube_TextFilter | ||
254 | 254 | } |
255 | 255 | |
256 | 256 | function makeClickableConvertTable(&$patterns, &$replacements) { |
257 | - $patterns[] = "/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([^, \r\n\"\(\)'<>]+)/i"; | |
257 | + // URI accept class ref. RFC 1738 (but not strict here) | |
258 | + $hpath = "[-_.!~*\'()a-z0-9;\/?:\@&=+\$,%#]+"; | |
259 | + $patterns[] = "/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/($hpath)/i"; | |
258 | 260 | $replacements[] = "\\1<a href=\"\\2://\\3\" rel=\"external\">\\2://\\3</a>"; |
259 | - $patterns[] = "/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i"; | |
261 | + $patterns[] = "/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.($hpath)/i"; | |
260 | 262 | $replacements[] = "\\1<a href=\"http://www.\\2.\\3\" rel=\"external\">www.\\2.\\3</a>"; |
261 | - $patterns[] = "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([^, \r\n\"\(\)'<>]+)/i"; | |
263 | + $patterns[] = "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.($hpath)/i"; | |
262 | 264 | $replacements[] = "\\1<a href=\"ftp://ftp.\\2.\\3\" rel=\"external\">ftp.\\2.\\3</a>"; |
263 | 265 | $patterns[] = "/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([a-z0-9!#\$%&'\*\+\-\/=\?^_\`{\|}~\.]+)/i"; |
264 | 266 | $replacements[] = "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>"; |