Last modified: 2013-09-26 06:10:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56357, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54357 - 404 page is wrong on sister projects when path starts with /w/
404 page is wrong on sister projects when path starts with /w/
Status: REOPENED
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
wmf-deployment
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-20 00:14 UTC by Matthew Flaschen
Modified: 2013-09-26 06:10 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Matthew Flaschen 2013-09-20 00:14:42 UTC
Visiting https://en.wiktionary.org/w/r/t yields the attached.

Note the link to Wikipedia.  However, https://en.wiktionary.org/foo works, so it's probably related to the fact that there's a real /w URL path.
Comment 2 Sam Reed (reedy) 2013-09-21 00:19:24 UTC
I've tidied up the file and removed some of the ancient unused code paths

The problem code is in this area:

if( preg_match( "|(%2f)|i", $loc, $matches )
	|| preg_match( "|^/upload/(.*)|i",$loc, $matches )
	|| preg_match("|^/style/(.*)|i",$loc, $matches )
	|| preg_match( "|^/wiki/(.*)|i",$loc, $matches )
	|| preg_match("|^/w/(.*)|i",$loc, $matches )
	|| preg_match( "|^/extensions/(.*)|i",$loc, $matches )
) {
	$title = htmlspecialchars( $matches[1] );
	$details = "<p style=\"font-weight: bold;\">To check for \"$title\" on Wikipedia, see:
				<a href=\"//en.wikipedia.org/wiki/$title\" title=\"Wikipedia:$title\">
				//en.wikipedia.org/wiki/$title</a></p>";
} else {
	$target = $prot . $serv . "/wiki" . $loc;
	$encTarget = htmlspecialchars( $target );
	header( "Refresh: 5; url=$encTarget" );
	$details="<p><b>Did you mean to type <a href=$encTarget>$encTarget</a>?</b>
			  You will be automatically redirected there in five seconds.</p>";
}
Comment 3 Gerrit Notification Bot 2013-09-21 00:30:17 UTC
Change 85380 had a related patch set uploaded by Reedy:
404 page is wrong on sister projects when path starts with /w/

https://gerrit.wikimedia.org/r/85380
Comment 4 Gerrit Notification Bot 2013-09-21 00:33:04 UTC
Change 85380 merged by Reedy:
404 page is wrong on sister projects when path starts with /w/

https://gerrit.wikimedia.org/r/85380
Comment 5 jeremyb 2013-09-24 02:18:50 UTC
not fixed AFAICT
Comment 6 Matthew Flaschen 2013-09-24 10:06:04 UTC
(In reply to comment #5)
> not fixed AFAICT

The example in my report (https://en.wiktionary.org/w/r/t) works.  It shows the correct 404 page, linking to https://en.wiktionary.org/wiki/r/t, just as https://en.wikipedia.org/w/r/t links to https://en.wikipedia.org/wiki/r/t

Is there a similar example that still points to the wrong place on a sister project?
Comment 7 jeremyb 2013-09-24 15:49:30 UTC
You said yields the "attached" but I see no attachment.

Is "/w/r/t" not supposed to go to /wiki/w/r/t ? ( https://en.wiktionary.org/wiki/WRT )
Comment 8 MZMcBride 2013-09-24 21:23:53 UTC
I agree with Jeremy that the current behavior isn't ideal. If a user visits <https://en.wiktionary.org/w/o>, he or she is currently prompted with:

---
To check for "o" see: https://en.wiktionary.org/wiki/o
---

This should be:

---
To check for "w/o" see: https://en.wiktionary.org/wiki/w/o
---

Perhaps we should special-case "w/"? This may be the subject of a separate (future) bug report, but it certainly seems like a valid bug to me.
Comment 9 Matthew Flaschen 2013-09-26 06:10:12 UTC
You're right, I forgot to attach it (nor does it look like I took it).  The issue was just that it linked to Wikipedia instead of Wiktionary.

It's not clear what the correct behavior is.  I agree in those examples, adding just /wiki would be better (e.g. https://en.wiktionary.org/wiki/w/o).

But it's quite possible someone could visit https://en.wikipedia.org/w/John%20Smith, in which case the current behavior is ideal (converting /w to /wiki).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links