#1488199 closed Bugs (fixed)

Infinite redirect on attachment preview

Reported by: agrath Owned by:
Priority: 5 Milestone: 0.7-stable
Component: Core functionality Version: 0.6-RC
Severity: normal Keywords:
Cc:

Description

Client reported attachments not loading, verified in IE & Chrome.

Tested with debugging proxy
Found infinite requests to URL?_preload=1&....
Checked code, in program/steps/mail/get.inc

if (!empty($_GET_preload?)) {

$url = str_replace('&_preload=1', , $_SERVERREQUEST_URI?);
$message = rcube_label('loadingdata');

Because in my case, first querystring parameter is _preload, (unsure if this is always the case) str_replace doesn't match and redirection to same url

Fixed by changing replaces to this:

$url = str_replace('?&','?',str_replace('&&','&',str_replace

('_preload=1', , $_SERVERREQUEST_URI?)));

Causes:

url?_preload=1&nextparam=2 to become url?&nextparam=2 and then url?nextparam=2
and
url?param=1&_preload=1&param2=2 to become url?param=1&&param2=2 then url?param1=&param2=2

Verified faulty str_replace existed in trac trunk before adding this

Attachments (1)

fix.txt (551 bytes) - added by agrath 18 months ago.

Download all attachments as: .zip

Change History (2)

Changed 18 months ago by agrath

comment:1 Changed 18 months ago by alec

  • Milestone changed from later to 0.7-stable
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [5510a527].

Note: See TracTickets for help on using tickets.