Changeset a1013c0 in github
- Timestamp:
- Jan 10, 2011 9:50:48 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 00e18b7
- Parents:
- 0ff554d
- Files:
-
- 3 edited
-
program/include/rcube_string_replacer.php (modified) (2 diffs)
-
tests/mailfunc.php (modified) (1 diff)
-
tests/src/plainbody.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_string_replacer.php
r0ff554d ra1013c0 38 38 // Simplified domain expression for UTF8 characters handling 39 39 $utf_domain = '[^?&@"\'\\/()\s\r\t\n]+\\.[a-z]{2,5}'; 40 $url = '[a-z0-9%=#@+?.:;&\\/_~\\[\\]-]+'; 40 $url1 = '.:;'; 41 $url2 = 'a-z0-9%=#@+?&\\/_~\\[\\]-'; 41 42 42 $this->link_pattern = "/([\w]+:\/\/|\Wwww\.)($utf_domain( $url)?)/i";43 $this->link_pattern = "/([\w]+:\/\/|\Wwww\.)($utf_domain([$url1]?[$url2]+)*)/i"; 43 44 $this->mailto_pattern = "/(" 44 45 ."[-\w!\#\$%&\'*+~\/^`|{}=]+(?:\.[-\w!\#\$%&\'*+~\/^`|{}=]+)*" // local-part 45 46 ."@$utf_domain" // domain-part 46 ."(\? $url)?"// e.g. ?subject=test...47 ."(\?[$url1$url2]+)?" // e.g. ?subject=test... 47 48 .")/i"; 48 49 } … … 89 90 } 90 91 91 $suffix = $this->parse_url_brackets($url); 92 $i = $this->add($prefix . html::a(array( 93 'href' => $url_prefix . $url, 94 'target' => '_blank' 95 ), Q($url)) . $suffix); 92 if ($url) { 93 $suffix = $this->parse_url_brackets($url); 94 $i = $this->add($prefix . html::a(array( 95 'href' => $url_prefix . $url, 96 'target' => '_blank' 97 ), Q($url)) . $suffix); 98 } 96 99 97 100 // Return valid link for recognized schemes, otherwise, return the unmodified string for unrecognized schemes. -
tests/mailfunc.php
r0ff554d ra1013c0 113 113 114 114 $this->assertPattern('/<a href="mailto:nobody@roundcube.net" onclick="return rcmail.command\(\'compose\',\'nobody@roundcube.net\',this\)">nobody@roundcube.net<\/a>/', $html, "Mailto links with onclick"); 115 $this->assertPattern('#<a href="http://www.apple.com/legal/privacy /" target="_blank">http://www.apple.com/legal/privacy/</a>#', $html, "Links with target=_blank");115 $this->assertPattern('#<a href="http://www.apple.com/legal/privacy" target="_blank">http://www.apple.com/legal/privacy</a>#', $html, "Links with target=_blank"); 116 116 $this->assertPattern('#\\[<a href="http://example.com/\\?tx\\[a\\]=5" target="_blank">http://example.com/\\?tx\\[a\\]=5</a>\\]#', $html, "Links with square brackets"); 117 117 } -
tests/src/plainbody.txt
r0ff554d ra1013c0 31 31 32 32 Privacy Policy 33 http://www.apple.com/legal/privacy /33 http://www.apple.com/legal/privacy. 34 34 35 35 My Info
Note: See TracChangeset
for help on using the changeset viewer.
