Page MenuHomePhabricator

Parameter validation in maintenance scripts needs work
Closed, ResolvedPublic

Description

Author: mediawiki-bugzilla

Description:
In maintenance/importTextFile.php (and possible others, haven't checked) you see constructs like the following:

$title = Title::newFromUrl( $title );
echo( "\nUsing title '" . $title->getPrefixedText() . "'..." );
if( is_object( $title ) ) {

and

$user = User::newFromName( $user );
echo( "\nUsing username '" . $user->getName() . "'..." );
if( is_object( $user ) ) {

When checking if the returned result is an object or not, one shouldn't try to use class functions before the check, of course.


Version: 1.11.x
Severity: minor

Details

Reference
bz11733

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:57 PM
bzimport set Reference to bz11733.