// Check for uppercase extension. We allow these filenames but check if an image
// with lowercase extension exists already
$warning = '';
// Check for uppercase extension. We allow these filenames but check if an image
// with lowercase extension exists already
$warning = '';
if( strpos( $file->getName(), '.' ) == false ) {
$partname = $file->getName();
if( strpos( $file->getName(), '.' ) == false ) {
$partname = $file->getName();
} else {
list( $partname, $rawExtension ) = explode( '.', $file->getName(), 2 );
}
} else {
list( $partname, $rawExtension ) = explode( '.', $file->getName(), 2 );
}
// Check for another file using the normalized form...
$nt_lc = Title::newFromText( $partname . '.' . $file->getExtension() );
$file_lc = wfLocalFile( $nt_lc );
// Check for another file using the normalized form...
$nt_lc = Title::newFromText( $partname . '.' . $file->getExtension() );
$file_lc = wfLocalFile( $nt_lc );
$warning .= '<li>' . wfMsgExt( 'fileexists', 'parseline', $dlink ) . '</li>' . $dlink2;
} elseif ( $file_lc && $file_lc->exists() ) {
$warning .= '<li>' . wfMsgExt( 'fileexists', 'parseline', $dlink ) . '</li>' . $dlink2;
} elseif ( $file_lc && $file_lc->exists() ) {
# Check if image with lowercase extension exists.
# It's not forbidden but in 99% it makes no sense to upload the same filename with uppercase extension
$dlink = $sk->makeKnownLinkObj( $nt_lc );
# Check if image with lowercase extension exists.
# It's not forbidden but in 99% it makes no sense to upload the same filename with uppercase extension
$dlink = $sk->makeKnownLinkObj( $nt_lc );