Make API action=upload return normalized file name on warning
"exists-normalized" instead of filename to be uploaded to.
This enables humans to see which file the current upload conflicts
with.
There is no point in returning the filename the upload should go to
because the client that makes the request is usually aware of this.
Bug: 52699
Change-Id: I898b7f234d43eb1e524952f6de80e401a8c96671
* Support for the 'gettoken' parameter to action=block and action=unblock,
deprecated since 1.20, has been removed.
* (bug 49090) Token-getting functions will fail when using jsonp callbacks.
+* (bug 52699) action=upload returns normalized file name on warning
+ "exists-normalized" instead of filename to be uploaded to.
=== Languages updated in 1.22===
if ( isset( $warnings['exists'] ) ) {
$warning = $warnings['exists'];
unset( $warnings['exists'] );
- $warnings[$warning['warning']] = $warning['file']->getName();
+ $localFile = isset( $warning['normalizedFile'] ) ? $warning['normalizedFile'] : $warning['file'];
+ $warnings[$warning['warning']] = $localFile->getName();
}
}
return $warnings;