Page MenuHomePhabricator

Diff parameter without a value will take you to latest diff of main page instead of showing a warning
Open, Needs TriagePublic

Description

In MediaWiki.php we have some logic that tries to gracefully handle situations in which only some parameters are passed through query string.

However, there is one edge case in which it has an expected result (at least IMHO). Going to https://en.wikipedia.org/w/index.php?diff= will take you to the latest diff for that wiki's main page. Instead, it should show a warning that neither the title nor the diff revision ID is provided.

Event Timeline

Huji created this task.Jul 26 2020, 1:00 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 26 2020, 1:00 AM
Huji updated the task description. (Show Details)Jul 26 2020, 2:11 AM
Huji renamed this task from Diff parameter without a value will take you to a random diff to Diff parameter without a value will take you to a diff instead of showing a warning.Jul 26 2020, 2:16 AM
Huji updated the task description. (Show Details)
Huji updated the task description. (Show Details)
Huji updated the task description. (Show Details)Jul 26 2020, 2:18 AM
Base added a subscriber: Base.Jul 26 2020, 7:27 AM

Instead, it should show a warning that neither the title nor the diff revision ID is provided.

why?

Huji added a comment.Jul 26 2020, 12:02 PM

That is a good question, and possibly the reason this task may be declined (if declined).

My reasoning is this: https://en.wikipedia.org/w/index.php?diff= is just an incomplete URL from which a human would not understand which page or which revision is intended, so choosing both a page and a revision arbitrarily is just too many assumptions by the code.

Isn't this expected behavior? /w/index.php is the default entry point, but wmf rewrites article paths to look pretty. /w/index.php?diff= does just what I'd expect with an empty or missing parameter diff parameter: it takes you to the latest diff of the page, which, when unprovided, defaults to the main page.

Huji added a comment.Jul 26 2020, 1:33 PM

Like I said, this task may be declined for that reason. I just feel like "expected" behavior is a bit subjective, and the fact that two assumptions are being made (both about the page and revision) is too liberal.

Aklapper renamed this task from Diff parameter without a value will take you to a diff instead of showing a warning to Diff parameter without a value will take you to latest diff of main page instead of showing a warning.Jul 26 2020, 8:03 PM