Last modified: 2011-08-05 14:53:15 UTC
bug 28578 was for action=parse, but action=expandtemplates does the same. ---- When action=expandtemplates receives an invalid title input, it defaults to "API" This can be seen at <http://en.wikipedia.org/w/api.php?action=expandtemplates&title=[a&text={{PAGENAME}}>. This behavior is unexpected and wrong. The api should die on invalid titles, see r88468. Thanks.
if ( !$title_obj ) { $title_obj = Title::newFromText( 'API' ); // default } It can quite obviously be seen in the code too ;)
(In reply to comment #1) > if ( !$title_obj ) { > $title_obj = Title::newFromText( 'API' ); // default > } > It can quite obviously be seen in the code too ;) Not all people looking first into the code ;-) There is also: 'title' => array( ApiBase::PARAM_DFLT => 'API', ), Maybe make title and text required?
r93905
(In reply to comment #2) > (In reply to comment #1) > > if ( !$title_obj ) { > > $title_obj = Title::newFromText( 'API' ); // default > > } > > It can quite obviously be seen in the code too ;) > > Not all people looking first into the code ;-) > > There is also: > > 'title' => array( > ApiBase::PARAM_DFLT => 'API', > ), > > Maybe make title and text required? No need to make Title required, if it's not a variable in the template expansion it is daft. However, making text needed makes sense, then we don't pointlessly go through the effort of trying to expand "", and hence, the api can die out earlier by making it required...
Resolved by r93905