Double slash in view photo URL (eg https://phonebook.mozilla.org//pic.php?mail=...)

RESOLVED FIXED

Status

Webtools
Phonebook
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: emorley, Assigned: atoll)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
Not exactly urgent but filing since I noticed it.

When on the view contact page, eg:
https://phonebook.mozilla.org/#search/USER@mozilla.com

The photo's link target (and image src URL) is of form:
https://phonebook.mozilla.org//pic.php?mail=USER@mozilla.com

ie contains a double slash.

The URL is defined here:
https://github.com/mozilla/phonebook/blob/a1349904d144321680ee1c47c43c910a1da0cd8d/config.php#L223

   $entry["picture"] = BASEPATH ."pic.php?mail=". $m[1];

It looks like this is the only time BASEPATH is used. BASEPATH itself is defined here:

https://github.com/mozilla/phonebook/blob/a1349904d144321680ee1c47c43c910a1da0cd8d/constants.php#L43

    define("BASEPATH", $protocol . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]) .'/');

I'm not sure whether it's ok to just drop the slash being appended there, or whether it may break eg the local testing case.
https://github.com/mozilla/phonebook/pull/43 drops BASEPATH entirely, going with href="pic.php" since that's what we do everywhere else in Phonebook.
(Reporter)

Comment 2

2 years ago
Many thanks :-)
Assignee: nobody → rsoderberg
Status: NEW → ASSIGNED

Comment 3

2 years ago
Commit pushed to master at https://github.com/mozilla/phonebook

https://github.com/mozilla/phonebook/commit/e48face610882e46e2a3fbc4ffb193d3203a4834
Merge pull request #43 from floatingatoll/bug1277548

Use relative HREF to pic.php, remove BASEPATH. [#1277548]
Fix deployed to production, CHG0010767.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.