$warnings['empty-file'] = true;
}
+ $hash = $this->getTempFileSha1Base36();
$exists = self::getExistsWarning( $localFile );
if ( $exists !== false ) {
$warnings['exists'] = $exists;
+
+ // check if file is an exact duplicate of current file version
+ if ( $hash === $localFile->getSha1() ) {
+ $warnings['no-change'] = $localFile;
+ }
+
+ // check if file is an exact duplicate of older versions of this file
+ $history = $localFile->getHistory();
+ foreach ( $history as $oldFile ) {
+ if ( $hash === $oldFile->getSha1() ) {
+ $warnings['duplicate-version'][] = $oldFile;
+ }
+ }
}
if ( $localFile->wasDeleted() && !$localFile->exists() ) {
}
// Check dupes against existing files
- $hash = $this->getTempFileSha1Base36();
$dupes = RepoGroup::singleton()->findBySha1( $hash );
$title = $this->getTitle();
// Remove all matches against self
* @return array Containing the namespace URI and prefix
*/
private static function splitXmlNamespace( $element ) {
- // 'http://www.w3.org/2000/svg:script' -> array( 'http://www.w3.org/2000/svg', 'script' )
+ // 'http://www.w3.org/2000/svg:script' -> [ 'http://www.w3.org/2000/svg', 'script' ]
$parts = explode( ':', strtolower( $element ) );
$name = array_pop( $parts );
$ns = implode( ':', $parts );