• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XOOPS Cube Legacy base repository


Commit MetaInfo

Revision1e344a1b777fe54bbd9d25407c803ca3f9418c35 (tree)
Zeit2011-11-05 13:45:59
Autornbuy <nbuy@704c...>
Commiternbuy

Log Message

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

Ändern Zusammenfassung

Diff

--- a/html/modules/legacy/kernel/Legacy_TextFilter.class.php
+++ b/html/modules/legacy/kernel/Legacy_TextFilter.class.php
@@ -254,11 +254,13 @@ class Legacy_TextFilter extends XCube_TextFilter
254254 }
255255
256256 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";
258260 $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";
260262 $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";
262264 $replacements[] = "\\1<a href=\"ftp://ftp.\\2.\\3\" rel=\"external\">ftp.\\2.\\3</a>";
263265 $patterns[] = "/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([a-z0-9!#\$%&'\*\+\-\/=\?^_\`{\|}~\.]+)/i";
264266 $replacements[] = "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>";