function upload( $src, $comment, $pageText, $flags = 0, $props = false,
$timestamp = false, $user = null, $tags = []
) {
- global $wgContLang;
-
if ( $this->getRepo()->getReadOnlyReason() !== false ) {
return $this->readOnlyFatalStatus();
}
// Trim spaces on user supplied text
$comment = trim( $comment );
- // Truncate nicely or the DB will do it for us
- // non-nicely (dangling multi-byte chars, non-truncated version in cache).
- $comment = $wgContLang->truncate( $comment, 255 );
$this->lock(); // begin
$status = $this->publish( $src, $flags, $options );
);
if ( isset( $status->value['revision'] ) ) {
- /** @var $rev Revision */
+ /** @var Revision $rev */
$rev = $status->value['revision'];
// Associate new page revision id
$logEntry->setAssociatedRevId( $rev->getId() );
// This relies on the resetArticleID() call in WikiPage::insertOn(),
// which is triggered on $descTitle by doEditContent() above.
if ( isset( $status->value['revision'] ) ) {
- /** @var $rev Revision */
+ /** @var Revision $rev */
$rev = $status->value['revision'];
$updateLogPage = $rev->getPage();
}