Index: filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.240
diff -u -p -r1.240 filter.module
--- filter/filter.module	21 Jan 2009 16:58:42 -0000	1.240
+++ filter/filter.module	23 Jan 2009 19:59:29 -0000
@@ -732,7 +732,7 @@ function _filter_url($text, $format) {
   $text = ' ' . $text . ' ';
 
   // Match absolute URLs.
-  $text = preg_replace_callback("`(<p>|<li>|<br\s*/?>|[ \n\r\t\(])((http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://)([a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+*~#&=/;-]))([.,?!]*?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))`i", '_filter_url_parse_full_links', $text);
+  $text = preg_replace_callback("`(<p>|<li>|<br\s*/?>|[ \n\r\t\(])((http://|https://|ftp://|mailto:|smb://|afp://|file://|gopher://|news://|ssl://|sslv2://|sslv3://|tls://|tcp://|udp://)([][a-zA-Z0-9@:%_+*~#?&=.,/;-]*[a-zA-Z0-9@:%_+*~#&=/;-]))([.,?!]*?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))`i", '_filter_url_parse_full_links', $text);
 
   // Match e-mail addresses.
   $text = preg_replace("`(<p>|<li>|<br\s*/?>|[ \n\r\t\(])([A-Za-z0-9._-]+@[A-Za-z0-9._+-]+\.[A-Za-z]{2,4})([.,?!]*?)(?=(</p>|</li>|<br\s*/?>|[ \n\r\t\)]))`i", '\1<a href="mailto:\2">\2</a>\3', $text);
Index: filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.13
diff -u -p -r1.13 filter.test
--- filter/filter.test	21 Jan 2009 16:58:42 -0000	1.13
+++ filter/filter.test	23 Jan 2009 19:59:29 -0000
@@ -214,7 +214,8 @@ class FilterTestCase extends DrupalWebTe
    * Test the HTML filter
    */
   function testHtmlFilter() {
-
+    $filtered = _filter_url('http://www.example.com/index.php?a[]=1', 'f');
+    $this->assertEqual($filtered, '<a href="http://www.example.com/index.php?a[]=1" title="http://www.example.com/index.php?a[]=1">http://www.example.com/index.php?a[]=1</a>', t('Converting URLs -- addresses with square brackets.'));
   }
 
   function createFormat($filter) {
