Page MenuHomePhabricator

index.php should handle section=T-1 etc. when using action=raw
Open, Needs TriagePublic

Description

index.php should handle section=T-1, section=T-2 etc the same way the query API does and how action=edit does. Currently, it just returns the entire page when it should only return the specific section as it would show if it were being transcluded.

Event Timeline

action=raw handles section=1 fine, but not section=T-1
I suspect the issue is related to the interaction between action=raw and section parsing

In ?action=raw, when section is requested the web request will return integer (section id) if it exists or null for anything else.

$request->getIntOrNull( 'section' );

You'll have to change that to just get the value; $request->getVal('section') but I don't know whether it's desirable.

So setting it to getIntOrNull in RawAction was done by Daniel Cannon in https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/393ce6d8df159c6a4c2364ee8d11f8b368b41dff%5E%21/#F1 / https://www.mediawiki.org/wiki/Special:Code/MediaWiki/26142 - T13353: api.php should be able to load only a section of wikitext of a page - in 2007

EditPage has used getVal since @brion did some cleanup of global variables in https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/014093acc4e0c277d0d92fdc54fb620210d6ec8a%5E%21/#F1 - in 2004

The task that added action=raw doesn't have any discussion about whether getVal or getIntOrNull should be used