* (bug 8975) Use "Maintenance script" as the username for importTextFile.php, not "MediaWiki default" as it could cause pages to be overwritten
* Use "Maintenance script" as the username for importImages.php, too * Clarified reserved username comment
This commit is contained in:
parent
46bf804286
commit
7fefaf95f9
4 changed files with 11 additions and 11 deletions
|
|
@ -298,6 +298,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
|
|||
* (bug 8780) Clarify message for command-line scripts if LocalSettings.php
|
||||
exists but is not readable
|
||||
* dumpBackup / importDump now work with PostgreSQL
|
||||
* (bug 8975) Use "Maintenance script" as the default username for importImages.php
|
||||
and importTextFile.php scripts
|
||||
|
||||
== Languages updated ==
|
||||
|
||||
|
|
|
|||
|
|
@ -2376,7 +2376,7 @@ $wgAllowDisplayTitle = false ;
|
|||
$wgReservedUsernames = array(
|
||||
'MediaWiki default', // Default 'Main Page' and MediaWiki: message pages
|
||||
'Conversion script', // Used for the old Wikipedia software upgrade
|
||||
'Maintenance script', // ... maintenance/edit.php uses this?
|
||||
'Maintenance script', // Maintenance scripts which perform editing, image import script
|
||||
'Template namespace initialisation script', // Used in 1.2->1.3 upgrade
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,15 +24,13 @@ if( count( $args ) > 1 ) {
|
|||
# Search the directory given and pull out suitable candidates
|
||||
$files = findFiles( $dir, $exts );
|
||||
|
||||
# Set up a fake user for this operation
|
||||
if( isset( $options['user'] ) ) {
|
||||
$wgUser = User::newFromName( $options['user'] );
|
||||
} else {
|
||||
$wgUser = User::newFromName( 'Image import script' );
|
||||
}
|
||||
if ( $wgUser->isAnon() ) {
|
||||
$wgUser->addToDatabase();
|
||||
}
|
||||
# Initialise the user for this operation
|
||||
$user = isset( $options['user'] )
|
||||
? User::newFromName( $options['user'] )
|
||||
: User::newFromName( 'Maintenance script' );
|
||||
if( !$user instanceof User )
|
||||
$user = User::newFromName( 'Maintenance script' );
|
||||
$wgUser = $user;
|
||||
|
||||
# Get the upload comment
|
||||
$comment = isset( $options['comment'] )
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ if( isset( $options['help'] ) ) {
|
|||
if( !$title->exists() || !isset( $options['nooverwrite'] ) ) {
|
||||
|
||||
$text = file_get_contents( $filename );
|
||||
$user = isset( $options['user'] ) ? $options['user'] : 'MediaWiki default';
|
||||
$user = isset( $options['user'] ) ? $options['user'] : 'Maintenance script';
|
||||
$user = User::newFromName( $user );
|
||||
echo( "\nUsing username '" . $user->getName() . "'..." );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue