Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -137,6 +137,7 @@ |
138 | 138 | files (like audio files) |
139 | 139 | * (bug 32168) Add wfAssembleUrl for use in wfExpandUrl |
140 | 140 | * (bug 32168) fixed - wfExpandUrl expands dot segments now |
| 141 | +* (bug 31535) Upload comments now truncated properly, and don't have brackets |
141 | 142 | |
142 | 143 | === API changes in 1.19 === |
143 | 144 | * (bug 19838) siprop=interwikimap can now use the interwiki cache. |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -1058,7 +1058,7 @@ |
1059 | 1059 | if ( $file->isDeleted( File::DELETED_COMMENT ) ) { |
1060 | 1060 | $row .= '<td><span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span></td>'; |
1061 | 1061 | } else { |
1062 | | - $row .= '<td dir="' . $wgContLang->getDir() . '">' . Linker::commentBlock( $description, $this->title ) . '</td>'; |
| 1062 | + $row .= '<td dir="' . $wgContLang->getDir() . '">' . Linker::formatComment( $description, $this->title ) . '</td>'; |
1063 | 1063 | } |
1064 | 1064 | |
1065 | 1065 | $rowClass = null; |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -893,6 +893,11 @@ |
894 | 894 | * archive name, or an empty string if it was a new file. |
895 | 895 | */ |
896 | 896 | function upload( $srcPath, $comment, $pageText, $flags = 0, $props = false, $timestamp = false, $user = null ) { |
| 897 | + global $wgContLang; |
| 898 | + // truncate nicely or the DB will do it for us |
| 899 | + // non-nicely (dangling multi-byte chars, non-truncated |
| 900 | + // version in cache). |
| 901 | + $comment = $wgContLang->truncate( $comment, 255 ); |
897 | 902 | $this->lock(); |
898 | 903 | $status = $this->publish( $srcPath, $flags ); |
899 | 904 | |