X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUpload.php;h=f7cb654527ba593ba8f2169ac75c6d50722b6d2b;hb=8de958444f1d36ecb95d3a53d96cc1404e95468e;hp=53b7a2ff3b494a100d90fd5ea177254112ffd485;hpb=b3e783f169cd41112e226409b36a926386a5a664;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 53b7a2ff3b..f7cb654527 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -617,7 +617,13 @@ class SpecialUpload extends SpecialPage { $licenseText = '== ' . $msg['license-header'] . " ==\n{{" . $license . "}}\n"; } - $pageText = $comment == '' ? '' : '== ' . $msg['filedesc'] . " ==\n" . $comment . "\n"; + $pageText = $comment . "\n"; + $headerText = '== ' . $msg['filedesc'] . ' =='; + if ( $comment !== '' && strpos( $comment, $headerText ) === false ) { + // prepend header to page text unless it's already there (or there is no content) + $pageText = $headerText . "\n" . $pageText; + } + if ( $config->get( 'UseCopyrightUpload' ) ) { $pageText .= '== ' . $msg['filestatus'] . " ==\n" . $copyStatus . "\n"; $pageText .= $licenseText;