[imp] Error in parsing of mailto: in compose

Richard Gilbert R.Gilbert at sheffield.ac.uk
Thu Nov 13 07:59:07 PST 2003


We have used scripts/Imp.reg to get imp (3.2.2) to be used when a mailto:
link is clicked with a managed Windows XP service.  A URL like the
following:

http://webmail.shef.ac.uk/horde/imp?action=compose&to=mailto:imp@lists.horde.org

leads to the following error message appearing:

Notice: Undefined index: query in
/local/local/apache/htdocs/horde/imp/lib/IMP.php on line 782:

	parse_str($mailto['query'], $vals);

There is no 'query' array element in the array produced by the preceding

	$mailto = @parse_url($args['to']);

I have modified the code to make the parsing of $mailto['query']
conditional as follows:

*** IMP.php.dist        Wed Feb 12 23:08:32 2003
--- IMP.php.new Wed Nov 12 17:28:23 2003
***************
*** 779,788 ****
              $mailto = @parse_url($args['to']);
              if (is_array($mailto)) {
                  $args['to'] = $mailto['path'];
!                 parse_str($mailto['query'], $vals);
!                 foreach ($fields as $val) {
!                     if (array_key_exists($val, $vals)) {
!                         $args[$val] = $vals[$val];
                      }
                  }
              }
--- 779,790 ----
              $mailto = @parse_url($args['to']);
              if (is_array($mailto)) {
                  $args['to'] = $mailto['path'];
!                 if (array_key_exists('query', $mailto)) {
!                     parse_str($mailto['query'], $vals);
!                     foreach ($fields as $val) {
!                         if (array_key_exists($val, $vals)) {
!                             $args[$val] = $vals[$val];
!                         }
                      }
                  }
              }


Richard
--
Richard Gilbert
Corporate Information and Computing Services
University of Sheffield, Sheffield, S10 2TN, UK
Phone: +44 114 222 3028   Fax: +44 114 222 3040


More information about the imp mailing list