]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - tests/URLDetectionTest.php
EmailRegistration plugin flow requires a confirmation address before user creation
[quix0rs-gnu-social.git] / tests / URLDetectionTest.php
1 <?php
2
3 if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
4     print "This script must be run from the command line\n";
5     exit();
6 }
7
8 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
9 define('GNUSOCIAL', true);
10 define('STATUSNET', true);  // compatibility
11
12 require_once INSTALLDIR . '/lib/common.php';
13
14 class URLDetectionTest extends PHPUnit_Framework_TestCase
15 {
16     /**
17      * @dataProvider provider
18      *
19      */
20     public function testProduction($content, $expected)
21     {
22         $rendered = common_render_text($content);
23         // hack!
24         $rendered = preg_replace('/id="attachment-\d+"/', 'id="attachment-XXX"', $rendered);
25         $this->assertEquals($expected, $rendered);
26     }
27
28     /**
29      * @dataProvider linkifyProvider
30      *
31      */
32     public function testLinkifyProduction($content, $expected, $config)
33     {
34         $rendered = common_render_text($content);
35         // hack!
36         $rendered = preg_replace('/id="attachment-\d+"/', 'id="attachment-XXX"', $rendered);
37         if(common_config('linkify', $config)){
38             $this->assertEquals($expected, $rendered);
39         } else {
40             $content = common_remove_unicode_formatting(nl2br(htmlspecialchars($content)));
41             $this->assertEquals($content, $rendered);
42         }
43     }
44
45     static public function provider()
46     {
47         return array(
48                      array('not a link :: no way',
49                            'not a link :: no way'),
50                      array('link http://www.somesite.com/xyz/35637563@N00/52803365/ link',
51                            'link <a href="http://www.somesite.com/xyz/35637563@N00/52803365/" title="http://www.somesite.com/xyz/35637563@N00/52803365/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://www.somesite.com/xyz/35637563@N00/52803365/</a> link'),
52                      array('http://127.0.0.1',
53                            '<a href="http://127.0.0.1/" title="http://127.0.0.1/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://127.0.0.1</a>'),
54                      array('http://[::1]:99/test.php',
55                            '<a href="http://[::1]:99/test.php" title="http://[::1]:99/test.php" rel="nofollow external">http://[::1]:99/test.php</a>'),
56                      array('http://::1/test.php',
57                            '<a href="http://::1/test.php" title="http://::1/test.php" rel="nofollow external">http://::1/test.php</a>'),
58                      array('http://::1',
59                            '<a href="http://::1/" title="http://::1/" rel="nofollow external">http://::1</a>'),
60                      array('http://127.0.0.1',
61                            '<a href="http://127.0.0.1/" title="http://127.0.0.1/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://127.0.0.1</a>'),
62                      array('http://example.com',
63                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>'),
64                      array('http://example.com.',
65                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>.'),
66                      array('/var/lib/example.so',
67                            '/var/lib/example.so'),
68                      array('example',
69                            'example'),
70                      array('mailto:user@example.com',
71                            '<a href="mailto:user@example.com" title="mailto:user@example.com" rel="nofollow external">mailto:user@example.com</a>'),
72                      array('mailto:user@example.com?subject=test',
73                            '<a href="mailto:user@example.com?subject=test" title="mailto:user@example.com?subject=test" rel="nofollow external">mailto:user@example.com?subject=test</a>'),
74                      array('xmpp:user@example.com',
75                            '<a href="xmpp:user@example.com" title="xmpp:user@example.com" rel="nofollow external">xmpp:user@example.com</a>'),
76                      array('#example',
77                            '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('example'))) . '" rel="tag">example</a></span>'),
78                      array('#example.com',
79                            '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('example.com'))) . '" rel="tag">example.com</a></span>'),
80                      array('#.net',
81                            '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('.net'))) . '" rel="tag">.net</a></span>'),
82                      array('http://example',
83                            '<a href="http://example/" title="http://example/" rel="nofollow external">http://example</a>'),
84                      array('http://3xampl3',
85                            '<a href="http://3xampl3/" title="http://3xampl3/" rel="nofollow external">http://3xampl3</a>'),
86                      array('http://example/',
87                            '<a href="http://example/" title="http://example/" rel="nofollow external">http://example/</a>'),
88                      array('http://example/path',
89                            '<a href="http://example/path" title="http://example/path" rel="nofollow external">http://example/path</a>'),
90                      array('http://example.com',
91                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>'),
92                      array('https://example.com',
93                            '<a href="https://example.com/" title="https://example.com/" rel="nofollow external">https://example.com</a>'),
94                      array('ftp://example.com',
95                            '<a href="ftp://example.com/" title="ftp://example.com/" rel="nofollow external">ftp://example.com</a>'),
96                      array('ftps://example.com',
97                            '<a href="ftps://example.com/" title="ftps://example.com/" rel="nofollow external">ftps://example.com</a>'),
98                      array('http://user@example.com',
99                            '<a href="http://@example.com/" title="http://@example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://user@example.com</a>'),
100                      array('http://user:pass@example.com',
101                            '<a href="http://@example.com/" title="http://@example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://user:pass@example.com</a>'),
102                      array('http://example.com:8080',
103                            '<a href="http://example.com:8080/" title="http://example.com:8080/" rel="nofollow external">http://example.com:8080</a>'),
104                      array('http://example.com:8080/test.php',
105                            '<a href="http://example.com:8080/test.php" title="http://example.com:8080/test.php" rel="nofollow external">http://example.com:8080/test.php</a>'),
106                      array('http://www.example.com',
107                            '<a href="http://www.example.com/" title="http://www.example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://www.example.com</a>'),
108                      array('http://example.com/',
109                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/</a>'),
110                      array('http://example.com/path',
111                            '<a href="http://example.com/path" title="http://example.com/path" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path</a>'),
112                      array('http://example.com/path.html',
113                            '<a href="http://example.com/path.html" title="http://example.com/path.html" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path.html</a>'),
114                      array('http://example.com/path.html#fragment',
115                            '<a href="http://example.com/path.html#fragment" title="http://example.com/path.html#fragment" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path.html#fragment</a>'),
116                      array('http://example.com/path.php?foo=bar&bar=foo',
117                            '<a href="http://example.com/path.php?foo=bar&amp;bar=foo" title="http://example.com/path.php?foo=bar&amp;bar=foo" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path.php?foo=bar&amp;bar=foo</a>'),
118                      array('http://example.com.',
119                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>.'),
120                      array('http://müllärör.de',
121                            '<a href="http://m&#xFC;ll&#xE4;r&#xF6;r.de/" title="http://m&#xFC;ll&#xE4;r&#xF6;r.de/" rel="nofollow external">http://müllärör.de</a>'),
122                      array('http://ﺱﺲﺷ.com',
123                            '<a href="http://&#xFEB1;&#xFEB2;&#xFEB7;.com/" title="http://&#xFEB1;&#xFEB2;&#xFEB7;.com/" rel="nofollow external">http://ﺱﺲﺷ.com</a>'),
124                      array('http://сделаткартинки.com',
125                            '<a href="http://&#x441;&#x434;&#x435;&#x43B;&#x430;&#x442;&#x43A;&#x430;&#x440;&#x442;&#x438;&#x43D;&#x43A;&#x438;.com/" title="http://&#x441;&#x434;&#x435;&#x43B;&#x430;&#x442;&#x43A;&#x430;&#x440;&#x442;&#x438;&#x43D;&#x43A;&#x438;.com/" rel="nofollow external">http://сделаткартинки.com</a>'),
126                      array('http://tūdaliņ.lv',
127                            '<a href="http://t&#x16B;dali&#x146;.lv/" title="http://t&#x16B;dali&#x146;.lv/" rel="nofollow external">http://tūdaliņ.lv</a>'),
128                      array('http://brændendekærlighed.com',
129                            '<a href="http://br&#xE6;ndendek&#xE6;rlighed.com/" title="http://br&#xE6;ndendek&#xE6;rlighed.com/" rel="nofollow external">http://brændendekærlighed.com</a>'),
130                      array('http://あーるいん.com',
131                            '<a href="http://&#x3042;&#x30FC;&#x308B;&#x3044;&#x3093;.com/" title="http://&#x3042;&#x30FC;&#x308B;&#x3044;&#x3093;.com/" rel="nofollow external">http://あーるいん.com</a>'),
132                      array('http://예비교사.com',
133                            '<a href="http://&#xC608;&#xBE44;&#xAD50;&#xC0AC;.com/" title="http://&#xC608;&#xBE44;&#xAD50;&#xC0AC;.com/" rel="nofollow external">http://예비교사.com</a>'),
134                      array('http://example.com.',
135                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>.'),
136                      array('http://example.com?',
137                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>?'),
138                      array('http://example.com!',
139                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>!'),
140                      array('http://example.com,',
141                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>,'),
142                      array('http://example.com;',
143                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>;'),
144                      array('http://example.com:',
145                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>:'),
146                      array('\'http://example.com\'',
147                            '\'<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>\''),
148                      array('"http://example.com"',
149                            '&quot;<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>&quot;'),
150                      array('"http://example.com/"',
151                            '&quot;<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/</a>&quot;'),
152                      array('http://example.com',
153                            '<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>'),
154                      array('(http://example.com)',
155                            '(<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>)'),
156                      array('[http://example.com]',
157                            '[<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>]'),
158                      array('<http://example.com>',
159                            '&lt;<a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a>&gt;'),
160                      array('http://example.com/path/(foo)/bar',
161                            '<a href="http://example.com/path/" title="http://example.com/path/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/</a>(foo)/bar'),
162                      array('http://example.com/path/[foo]/bar',
163                            '<a href="http://example.com/path/" title="http://example.com/path/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/</a>[foo]/bar'),
164                      array('http://example.com/path/foo/(bar)',
165                            '<a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/foo/</a>(bar)'),
166                      //Not a valid url - urls cannot contain unencoded square brackets
167                      array('http://example.com/path/foo/[bar]',
168                            '<a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/foo/</a>[bar]'),
169                      array('Hey, check out my cool site http://example.com okay?',
170                            'Hey, check out my cool site <a href="http://example.com/" title="http://example.com/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com</a> okay?'),
171                      array('What about parens (e.g. http://example.com/path/foo/(bar))?',
172                            'What about parens (e.g. <a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/foo/</a>(bar))?'),
173                      array('What about parens (e.g. http://example.com/path/foo/(bar)?',
174                            'What about parens (e.g. <a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/foo/</a>(bar)?'),
175                      array('What about parens (e.g. http://example.com/path/foo/(bar).)?',
176                            'What about parens (e.g. <a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/foo/</a>(bar).)?'),
177                      //Not a valid url - urls cannot contain unencoded commas
178                      array('What about parens (e.g. http://example.com/path/(foo,bar)?',
179                            'What about parens (e.g. <a href="http://example.com/path/" title="http://example.com/path/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/</a>(foo,bar)?'),
180                      array('Unbalanced too (e.g. http://example.com/path/((((foo)/bar)?',
181                            'Unbalanced too (e.g. <a href="http://example.com/path/" title="http://example.com/path/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/</a>((((foo)/bar)?'),
182                      array('Unbalanced too (e.g. http://example.com/path/(foo))))/bar)?',
183                            'Unbalanced too (e.g. <a href="http://example.com/path/" title="http://example.com/path/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/</a>(foo))))/bar)?'),
184                      array('Unbalanced too (e.g. http://example.com/path/foo/((((bar)?',
185                            'Unbalanced too (e.g. <a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/foo/</a>((((bar)?'),
186                      array('Unbalanced too (e.g. http://example.com/path/foo/(bar))))?',
187                            'Unbalanced too (e.g. <a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="nofollow external noreferrer" class="attachment" id="attachment-XXX">http://example.com/path/foo/</a>(bar))))?'),
188                      array('file.ext',
189                            'file.ext'),
190                      array('file.html',
191                            'file.html'),
192                      array('file.php',
193                            'file.php'),
194
195                      // scheme-less HTTP URLs with @ in the path: http://status.net/open-source/issues/2248
196                      array('http://flickr.com/photos/34807140@N05/3838905434',
197                            '<a href="http://www.flickr.com/photos/34807140@N05/3838905434" title="http://www.flickr.com/photos/34807140@N05/3838905434" rel="nofollow external noreferrer" class="attachment thumbnail" id="attachment-XXX">http://flickr.com/photos/34807140@N05/3838905434</a>'),
198                      );
199     }
200
201     static public function linkifyProvider()
202     {
203         return array(
204             //bare ip addresses are no longer supported
205             array('127.0.0.1',
206                   '<a href="http://127.0.0.1/" title="http://127.0.0.1/" rel="nofollow external">127.0.0.1</a>',
207                   'bare_ipv4'),
208             array('127.0.0.1:99',
209                   '<a href="http://127.0.0.1:99/" title="http://127.0.0.1:99/" rel="nofollow external">127.0.0.1:99</a>',
210                   'bare_ipv4'),
211             array('127.0.0.1/Name:test.php',
212                   '<a href="http://127.0.0.1/Name:test.php" title="http://127.0.0.1/Name:test.php" rel="nofollow external">127.0.0.1/Name:test.php</a>',
213                   'bare_ipv4'),
214             array('127.0.0.1/~test',
215                   '<a href="http://127.0.0.1/~test" title="http://127.0.0.1/~test" rel="nofollow external">127.0.0.1/~test</a>',
216                   'bare_ipv4'),
217             array('127.0.0.1/+test',
218                   '<a href="http://127.0.0.1/+test" title="http://127.0.0.1/+test" rel="nofollow external">127.0.0.1/+test</a>',
219                   'bare_ipv4'),
220             array('127.0.0.1/$test',
221                   '<a href="http://127.0.0.1/$test" title="http://127.0.0.1/$test" rel="nofollow external">127.0.0.1/$test</a>',
222                   'bare_ipv4'),
223             array('127.0.0.1/\'test',
224                   '<a href="http://127.0.0.1/\'test" title="http://127.0.0.1/\'test" rel="nofollow external">127.0.0.1/\'test</a>',
225                   'bare_ipv4'),
226             array('127.0.0.1/"test',
227                   '<a href="http://127.0.0.1/" title="http://127.0.0.1/" rel="nofollow external">127.0.0.1/</a>&quot;test',
228                   'bare_ipv4'),
229             array('127.0.0.1/test"test',
230                   '<a href="http://127.0.0.1/test" title="http://127.0.0.1/test" rel="nofollow external">127.0.0.1/test</a>&quot;test',
231                   'bare_ipv4'),
232             array('127.0.0.1/-test',
233                   '<a href="http://127.0.0.1/-test" title="http://127.0.0.1/-test" rel="nofollow external">127.0.0.1/-test</a>',
234                   'bare_ipv4'),
235             array('127.0.0.1/_test',
236                   '<a href="http://127.0.0.1/_test" title="http://127.0.0.1/_test" rel="nofollow external">127.0.0.1/_test</a>',
237                   'bare_ipv4'),
238             array('127.0.0.1/!test',
239                   '<a href="http://127.0.0.1/!test" title="http://127.0.0.1/!test" rel="nofollow external">127.0.0.1/!test</a>',
240                   'bare_ipv4'),
241             array('127.0.0.1/*test',
242                   '<a href="http://127.0.0.1/*test" title="http://127.0.0.1/*test" rel="nofollow external">127.0.0.1/*test</a>',
243                   'bare_ipv4'),
244             array('127.0.0.1/test%20stuff',
245                   '<a href="http://127.0.0.1/test%20stuff" title="http://127.0.0.1/test%20stuff" rel="nofollow external">127.0.0.1/test%20stuff</a>',
246                   'bare_ipv4'),
247             array('2001:4978:1b5:0:21d:e0ff:fe66:59ab/test.php',
248                   '<a href="http://2001:4978:1b5:0:21d:e0ff:fe66:59ab/test.php" title="http://2001:4978:1b5:0:21d:e0ff:fe66:59ab/test.php" rel="nofollow external">2001:4978:1b5:0:21d:e0ff:fe66:59ab/test.php</a>',
249                   'bare_ipv6'),
250             array('[2001:4978:1b5:0:21d:e0ff:fe66:59ab]:99/test.php',
251                   '<a href="http://[2001:4978:1b5:0:21d:e0ff:fe66:59ab]:99/test.php" title="http://[2001:4978:1b5:0:21d:e0ff:fe66:59ab]:99/test.php" rel="nofollow external">[2001:4978:1b5:0:21d:e0ff:fe66:59ab]:99/test.php</a>',
252                   'bare_ipv6'),
253             array('2001:4978:1b5:0:21d:e0ff:fe66:59ab',
254                   '<a href="http://2001:4978:1b5:0:21d:e0ff:fe66:59ab/" title="http://2001:4978:1b5:0:21d:e0ff:fe66:59ab/" rel="nofollow external">2001:4978:1b5:0:21d:e0ff:fe66:59ab</a>',
255                   'bare_ipv6'),
256             array('example.com',
257                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>',
258                   'bare_domains'),
259             array('flickr.com/photos/34807140@N05/3838905434',
260                   '<a href="http://flickr.com/photos/34807140@N05/3838905434" title="http://flickr.com/photos/34807140@N05/3838905434" class="attachment thumbnail" id="attachment-XXX" rel="nofollow external">flickr.com/photos/34807140@N05/3838905434</a>',
261                   'bare_domains'),
262             array('What about parens (e.g. example.com/path/foo/(bar))?',
263                   'What about parens (e.g. <a href="http://example.com/path/foo/(bar)" title="http://example.com/path/foo/(bar)" rel="nofollow external">example.com/path/foo/(bar)</a>)?',
264                   'bare_domains'),
265             array('What about parens (e.g. example.com/path/foo/(bar)?',
266                   'What about parens (e.g. <a href="http://example.com/path/foo/(bar)" title="http://example.com/path/foo/(bar)" rel="nofollow external">example.com/path/foo/(bar)</a>?',
267                   'bare_domains'),
268             array('What about parens (e.g. example.com/path/foo/(bar).)?',
269                   'What about parens (e.g. <a href="http://example.com/path/foo/(bar)" title="http://example.com/path/foo/(bar)" rel="nofollow external">example.com/path/foo/(bar)</a>.?',
270                   'bare_domains'),
271             array('What about parens (e.g. example.com/path/(foo,bar)?',
272                   'What about parens (e.g. <a href="http://example.com/path/(foo,bar)" title="http://example.com/path/(foo,bar)" rel="nofollow external">example.com/path/(foo,bar)</a>?',
273                   'bare_domains'),
274             array('example.com',
275                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>',
276                   'bare_domains'),
277             array('example.org',
278                   '<a href="http://example.org/" title="http://example.org/" rel="nofollow external">example.org</a>',
279                   'bare_domains'),
280             array('example.co.uk',
281                   '<a href="http://example.co.uk/" title="http://example.co.uk/" rel="nofollow external">example.co.uk</a>',
282                   'bare_domains'),
283             array('www.example.co.uk',
284                   '<a href="http://www.example.co.uk/" title="http://www.example.co.uk/" rel="nofollow external">www.example.co.uk</a>',
285                   'bare_domains'),
286             array('farm1.images.example.co.uk',
287                   '<a href="http://farm1.images.example.co.uk/" title="http://farm1.images.example.co.uk/" rel="nofollow external">farm1.images.example.co.uk</a>',
288                   'bare_domains'),
289             array('example.museum',
290                   '<a href="http://example.museum/" title="http://example.museum/" rel="nofollow external">example.museum</a>',
291                   'bare_domains'),
292             array('example.travel',
293                   '<a href="http://example.travel/" title="http://example.travel/" rel="nofollow external">example.travel</a>',
294                   'bare_domains'),
295             array('example.com.',
296                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>.',
297                   'bare_domains'),
298             array('example.com?',
299                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>?',
300                   'bare_domains'),
301             array('example.com!',
302                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>!',
303                   'bare_domains'),
304             array('example.com,',
305                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>,',
306                   'bare_domains'),
307             array('example.com;',
308                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>;',
309                   'bare_domains'),
310             array('example.com:',
311                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>:',
312                   'bare_domains'),
313             array('\'example.com\'',
314                   '\'<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>\'',
315                   'bare_domains'),
316             array('"example.com"',
317                   '&quot;<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>&quot;',
318                   'bare_domains'),
319             array('example.com',
320                   '<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>',
321                   'bare_domains'),
322             array('(example.com)',
323                   '(<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>)',
324                   'bare_domains'),
325             array('[example.com]',
326                   '[<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>]',
327                   'bare_domains'),
328             array('<example.com>',
329                   '&lt;<a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>&gt;',
330                   'bare_domains'),
331             array('Hey, check out my cool site example.com okay?',
332                   'Hey, check out my cool site <a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a> okay?',
333                   'bare_domains'),
334             array('Hey, check out my cool site example.com.I made it.',
335                   'Hey, check out my cool site <a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>.I made it.',
336                   'bare_domains'),
337             array('Hey, check out my cool site example.com.Funny thing...',
338                   'Hey, check out my cool site <a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>.Funny thing...',
339                   'bare_domains'),
340             array('Hey, check out my cool site example.com.You will love it.',
341                   'Hey, check out my cool site <a href="http://example.com/" title="http://example.com/" rel="nofollow external">example.com</a>.You will love it.',
342                   'bare_domains'),
343             array('example.com:8080/test.php',
344                   '<a href="http://example.com:8080/test.php" title="http://example.com:8080/test.php" rel="nofollow external">example.com:8080/test.php</a>',
345                   'bare_domains'),
346             array('user_name+other@example.com',
347                   '<a href="mailto:user_name+other@example.com" title="mailto:user_name+other@example.com" rel="nofollow external">user_name+other@example.com</a>',
348                   'bare_domains'),
349             array('user@example.com',
350                   '<a href="mailto:user@example.com" title="mailto:user@example.com" rel="nofollow external">user@example.com</a>',
351                   'bare_domains'),
352         );
353     }
354 }
355