From: Victor Vasiliev Date: Sat, 26 Jan 2008 19:44:31 +0000 (+0000) Subject: Show warning if image page exists X-Git-Tag: 1.31.0-rc.0~49764 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=f31672cc01c1250261d1d31f83e5127195aa3e59;p=lhc%2Fweb%2Fwiklou.git Show warning if image page exists --- diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 657a1a5d8e..07d134b329 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -610,6 +610,9 @@ class UploadForm { $warning .= '
  • ' . wfMsgExt( 'fileexists', 'parseline', $dlink ) . '
  • ' . $dlink2; + } elseif( $file->getTitle()->getArticleID() ) { + $lnk = $sk->makeKnownLinkObj( $file->getTitle(), '', 'redirect=no' ); + $warning .= '
  • ' . wfMsgExt( 'filepageexists', 'parseline', $lnk ) . '
  • '; } 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 diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e06f6d0f12..98d83519ea 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1451,6 +1451,7 @@ To include the image in a page, use a link in the form '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 $1 if you are not sure if you want to change it.', +'filepageexists' => 'A page (not image) with this name exists already, please check $1 if you are not sure if you want to change it.', 'fileexists-extension' => 'A file with a similar name exists:
    Name of the uploading file: $1
    Name of the existing file: $2
    diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 87326f8da0..804fbdfd8f 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -851,6 +851,7 @@ $wgMessageStructure = array( 'largefileserver', 'emptyfile', 'fileexists', + 'filepageexists', 'fileexists-extension', 'fileexists-thumb', 'fileexists-thumbnail-yes',