Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -315,7 +315,7 @@ |
316 | 316 | foreach( $warnings as $warning => $args ) { |
317 | 317 | $msg = ''; |
318 | 318 | if( $warning == 'exists' ) { |
319 | | - $msg = self::getExistsWarning( $args ); |
| 319 | + $msg = "\t<li>" . self::getExistsWarning( $args ) . "</li>\n"; |
320 | 320 | } elseif( $warning == 'duplicate' ) { |
321 | 321 | $msg = self::getDupeWarning( $args ); |
322 | 322 | } elseif( $warning == 'duplicate-archive' ) { |
— | — | @@ -323,7 +323,7 @@ |
324 | 324 | array( Title::makeTitle( NS_FILE, $args )->getPrefixedText() ) ) |
325 | 325 | . "</li>\n"; |
326 | 326 | } else { |
327 | | - if ( is_bool( $args ) ) |
| 327 | + if ( $args === true ) |
328 | 328 | $args = array(); |
329 | 329 | elseif ( !is_array( $args ) ) |
330 | 330 | $args = array( $args ); |
— | — | @@ -569,7 +569,6 @@ |
570 | 570 | * |
571 | 571 | * @param array $exists The result of UploadBase::getExistsWarning |
572 | 572 | * @return string Empty string if there is no warning or an HTML fragment |
573 | | - * consisting of one or more <li> elements if there is a warning. |
574 | 573 | */ |
575 | 574 | public static function getExistsWarning( $exists ) { |
576 | 575 | global $wgUser, $wgContLang; |
— | — | @@ -579,30 +578,30 @@ |
580 | 579 | |
581 | 580 | $file = $exists['file']; |
582 | 581 | $filename = $file->getTitle()->getPrefixedText(); |
583 | | - $warning = array(); |
| 582 | + $warning = ''; |
584 | 583 | |
585 | 584 | $sk = $wgUser->getSkin(); |
586 | 585 | |
587 | 586 | if( $exists['warning'] == 'exists' ) { |
588 | 587 | // Exact match |
589 | | - $warning[] = '<li>' . wfMsgExt( 'fileexists', 'parseinline', $filename ) . '</li>'; |
| 588 | + $warning = wfMsgExt( 'fileexists', 'parseinline', $filename ); |
590 | 589 | } elseif( $exists['warning'] == 'page-exists' ) { |
591 | 590 | // Page exists but file does not |
592 | | - $warning[] = '<li>' . wfMsgExt( 'filepageexists', 'parseinline', $filename ) . '</li>'; |
| 591 | + $warning = wfMsgExt( 'filepageexists', 'parseinline', $filename ); |
593 | 592 | } elseif ( $exists['warning'] == 'exists-normalized' ) { |
594 | | - $warning[] = '<li>' . wfMsgExt( 'fileexists-extension', 'parseinline', $filename, |
595 | | - $exists['normalizedFile']->getTitle()->getPrefixedText() ) . '</li>'; |
| 593 | + $warning = wfMsgExt( 'fileexists-extension', 'parseinline', $filename, |
| 594 | + $exists['normalizedFile']->getTitle()->getPrefixedText() ); |
596 | 595 | } elseif ( $exists['warning'] == 'thumb' ) { |
597 | 596 | // Swapped argument order compared with other messages for backwards compatibility |
598 | | - $warning[] = '<li>' . wfMsgExt( 'fileexists-thumbnail-yes', 'parseinline', |
599 | | - $exists['thumbFile']->getTitle()->getPrefixedText(), $filename ) . '</li>'; |
| 597 | + $warning = wfMsgExt( 'fileexists-thumbnail-yes', 'parseinline', |
| 598 | + $exists['thumbFile']->getTitle()->getPrefixedText(), $filename ); |
600 | 599 | } elseif ( $exists['warning'] == 'thumb-name' ) { |
601 | 600 | // Image w/o '180px-' does not exists, but we do not like these filenames |
602 | 601 | $name = $file->getName(); |
603 | 602 | $badPart = substr( $name, 0, strpos( $name, '-' ) + 1 ); |
604 | | - $warning[] = '<li>' . wfMsgExt( 'file-thumbnail-no', 'parseinline', $badPart ) . '</li>'; |
| 603 | + $warning = wfMsgExt( 'file-thumbnail-no', 'parseinline', $badPart ); |
605 | 604 | } elseif ( $exists['warning'] == 'bad-prefix' ) { |
606 | | - $warning[] = '<li>' . wfMsgExt( 'filename-bad-prefix', 'parseinline', $exists['prefix'] ) . '</li>'; |
| 605 | + $warning = wfMsgExt( 'filename-bad-prefix', 'parseinline', $exists['prefix'] ); |
607 | 606 | } elseif ( $exists['warning'] == 'was-deleted' ) { |
608 | 607 | # If the file existed before and was deleted, warn the user of this |
609 | 608 | $ltitle = SpecialPage::getTitleFor( 'Log' ); |
— | — | @@ -615,10 +614,10 @@ |
616 | 615 | 'page' => $filename |
617 | 616 | ) |
618 | 617 | ); |
619 | | - $warning[] = '<li>' . wfMsgWikiHtml( 'filewasdeleted', $llink ) . '</li>'; |
| 618 | + $warning = wfMsgWikiHtml( 'filewasdeleted', $llink ); |
620 | 619 | } |
621 | 620 | |
622 | | - return implode( "\n", $warning ); |
| 621 | + return $warning; |
623 | 622 | } |
624 | 623 | |
625 | 624 | /** |
— | — | @@ -639,7 +638,7 @@ |
640 | 639 | $exists = UploadBase::getExistsWarning( $file ); |
641 | 640 | $warning = self::getExistsWarning( $exists ); |
642 | 641 | if ( $warning !== '' ) { |
643 | | - $s = "<ul>$warning</ul>"; |
| 642 | + $s = "<div>$warning</div>"; |
644 | 643 | } |
645 | 644 | } |
646 | 645 | return $s; |