#1487979 closed Bug Patches (fixed)

rcmail->url() will omit parameter if value equals zero (php's empty vicissitudes)

Reported by: cabeca Owned by:
Priority: 2 Milestone: 0.6-beta
Component: Core functionality Version: git-master
Severity: major Keywords:
Cc:

Description

Hi,

rcmail->url() will omit parameter if value equals zero. This is because php's empty() treats any value with 0 (zero) as true. There are cases when you want a url parameter with the value zero, for example when displaying contact photos:

https://example.com/rc/?_task=addressbook&_source=0&_cid=7400&_action=photo

Without _source parameter (as will happen with the current code, when _source equals zero) the photo doesn't appear.

Below is a patch to solve this particular issue, but maybe a full scan of the roundcube code is needed to see if empty() is really the function one wants to use, or if ''=== makes more sense in certain cases.

Best Regards
Miguel Cabeça

Attachments (1)

roundcube_fix_rcmail_url.patch (507 bytes) - added by cabeca 23 months ago.

Download all attachments as: .zip

Change History (2)

Changed 23 months ago by cabeca

comment:1 Changed 23 months ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [77406bb7].

Note: See TracTickets for help on using tickets.