$warning .= '<li>' . wfMsgExt( 'fileexists', 'parseline', $dlink ) . '</li>' . $dlink2;
+ } elseif( $file->getTitle()->getArticleID() ) {
+ $lnk = $sk->makeKnownLinkObj( $file->getTitle(), '', 'redirect=no' );
+ $warning .= '<li>' . wfMsgExt( 'filepageexists', 'parseline', $lnk ) . '</li>';
} 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
'largefileserver' => 'This file is bigger than the server is configured to allow.',
'emptyfile' => 'The file you uploaded seems to be empty. This might be due to a typo in the file name. Please check whether you really want to upload this file.',
'fileexists' => 'A file with this name exists already, please check <strong><tt>$1</tt></strong> if you are not sure if you want to change it.',
+'filepageexists' => 'A page (not image) with this name exists already, please check <strong><tt>$1</tt></strong> if you are not sure if you want to change it.',
'fileexists-extension' => 'A file with a similar name exists:<br />
Name of the uploading file: <strong><tt>$1</tt></strong><br />
Name of the existing file: <strong><tt>$2</tt></strong><br />