r81698 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81697‎ | r81698 | r81699 >
Date:08:21, 8 February 2011
Author:catrope
Status:ok
Tags:
Comment:
1.17wmf1: MFT r80837, r81612, r81615, r81657, r81674, r81689
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/DoubleWiki/DoubleWiki_body.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/DefaultSettings.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/User.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/db/Database.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/upload/UploadFromUrl.php (modified) (history)
  • /branches/wmf/1.17wmf1/maintenance/addwiki.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/maintenance/addwiki.php
@@ -31,12 +31,16 @@
3232
3333 class AddWiki extends Maintenance {
3434 public function __construct() {
 35+ global $wgNoDBParam;
 36+
3537 parent::__construct();
3638 $this->mDescription = "Add a new wiki to the family. Wikimedia specific!";
3739 $this->addArg( 'language', 'Language code of new site, e.g. en' );
3840 $this->addArg( 'site', 'Type of site, e.g. wikipedia' );
3941 $this->addArg( 'dbname', 'Name of database to create, e.g. enwiki' );
4042 $this->addArg( 'domain', 'Domain name of the wiki, e.g. en.wikipedia.org' );
 43+
 44+ $wgNoDBParam = true;
4145 }
4246
4347 public function getDbType() {
@@ -44,9 +48,8 @@
4549 }
4650
4751 public function execute() {
48 - global $IP, $wgDefaultExternalStore, $wgNoDBParam;
 52+ global $IP, $wgDefaultExternalStore;
4953
50 - $wgNoDBParam = true;
5154 $lang = $this->getArg( 0 );
5255 $site = $this->getArg( 1 );
5356 $dbName = $this->getArg( 2 );
Index: branches/wmf/1.17wmf1/extensions/DoubleWiki/DoubleWiki_body.php
@@ -252,6 +252,8 @@
253253 * The first and last slices are compensated.
254254 */
255255 $stack = array();
 256+ $opening = '';
 257+
256258 for( $i=0 ; $i < $n ; $i++) {
257259 $bits = preg_split( $this->tags, $left_slices[$i] );
258260 preg_match_all( $this->tags, $left_slices[$i], $m, PREG_SET_ORDER);
@@ -267,7 +269,6 @@
268270 }
269271 }
270272 if( $i==0 ) {
271 - $opening = '';
272273 $closure = '';
273274 for( $k=0; $k < $counter ; $k++ ) {
274275 $opening .= "<".$stack[$k][1].">";
Index: branches/wmf/1.17wmf1/includes/upload/UploadFromUrl.php
@@ -45,6 +45,9 @@
4646
4747 $this->mUrl = $url;
4848 $this->mAsync = $wgAllowAsyncCopyUploads ? $async : false;
 49+ if ( $async ) {
 50+ throw new MWException( 'Asynchronous copy uploads are no longer possible as of r81612.' );
 51+ }
4952
5053 $tempPath = $this->mAsync ? null : $this->makeTemporaryFile();
5154 # File size and removeTempFile will be filled in later
Index: branches/wmf/1.17wmf1/includes/User.php
@@ -3768,92 +3768,4 @@
37693769
37703770 return $ret;
37713771 }
3772 -
3773 - /**
3774 - * Format the user message using a hook, a template, or, failing these, a static format.
3775 - * @param $subject String the subject of the message
3776 - * @param $text String the content of the message
3777 - * @param $signature String the signature, if provided.
3778 - */
3779 - static protected function formatUserMessage( $subject, $text, $signature ) {
3780 - if ( wfRunHooks( 'FormatUserMessage',
3781 - array( $subject, &$text, $signature ) ) ) {
3782 -
3783 - $signature = empty($signature) ? "~~~~~" : "{$signature} ~~~~~";
3784 -
3785 - $template = Title::newFromText( wfMsgForContent( 'usermessage-template' ) );
3786 - if ( !$template
3787 - || $template->getNamespace() !== NS_TEMPLATE
3788 - || !$template->exists() ) {
3789 - $text = "\n== $subject ==\n\n$text\n\n-- $signature";
3790 - } else {
3791 - $text = '{{'. $template->getText()
3792 - . " | subject=$subject | body=$text | signature=$signature }}";
3793 - }
3794 - }
3795 -
3796 - return $text;
3797 - }
3798 -
3799 - /**
3800 - * Leave a user a message
3801 - * @param $subject String the subject of the message
3802 - * @param $text String the message to leave
3803 - * @param $signature String Text to leave in the signature
3804 - * @param $summary String the summary for this change, defaults to
3805 - * "Leave system message."
3806 - * @param $editor User The user leaving the message, defaults to
3807 - * "{{MediaWiki:usermessage-editor}}"
3808 - * @param $flags Int default edit flags
3809 - *
3810 - * @return boolean true if it was successful
3811 - */
3812 - public function leaveUserMessage( $subject, $text, $signature = "",
3813 - $summary = null, $editor = null, $flags = 0 ) {
3814 - if ( !isset( $summary ) ) {
3815 - $summary = wfMsgForContent( 'usermessage-summary' );
3816 - }
3817 -
3818 - if ( !isset( $editor ) ) {
3819 - $editor = User::newFromName( wfMsgForContent( 'usermessage-editor' ) );
3820 - if ( !$editor->isLoggedIn() ) {
3821 - $editor->addToDatabase();
3822 - }
3823 - }
3824 -
3825 - $article = new Article( $this->getTalkPage() );
3826 - wfRunHooks( 'SetupUserMessageArticle',
3827 - array( $this, &$article, $subject, $text, $signature, $summary, $editor ) );
3828 -
3829 -
3830 - $text = self::formatUserMessage( $subject, $text, $signature );
3831 - $flags = $article->checkFlags( $flags );
3832 -
3833 - if ( $flags & EDIT_UPDATE ) {
3834 - $text = $article->getContent() . $text;
3835 - }
3836 -
3837 - $dbw = wfGetDB( DB_MASTER );
3838 - $dbw->begin();
3839 -
3840 - try {
3841 - $status = $article->doEdit( $text, $summary, $flags, false, $editor );
3842 - } catch ( DBQueryError $e ) {
3843 - $status = Status::newFatal("DB Error");
3844 - }
3845 -
3846 - if ( $status->isGood() ) {
3847 - // Set newtalk with the right user ID
3848 - $this->setNewtalk( true );
3849 - wfRunHooks( 'AfterUserMessage',
3850 - array( $this, $article, $summary, $text, $signature, $summary, $editor ) );
3851 - $dbw->commit();
3852 - } else {
3853 - // The article was concurrently created
3854 - wfDebug( __METHOD__ . ": Error ".$status->getWikiText() );
3855 - $dbw->rollback();
3856 - }
3857 -
3858 - return $status->isGood();
3859 - }
38603772 }
Property changes on: branches/wmf/1.17wmf1/includes/User.php
___________________________________________________________________
Modified: svn:mergeinfo
38613773 Merged /trunk/phase3/includes/User.php:r80837,81612,81615,81657,81674,81689
Index: branches/wmf/1.17wmf1/includes/db/Database.php
@@ -1611,7 +1611,7 @@
16121612 if ( !$alias || $alias == $name ) {
16131613 return $this->tableName( $name );
16141614 } else {
1615 - return $this->tableName( $name ) . ' `' . $alias . '`';
 1615+ return $this->tableName( $name ) . $this->addQuotes( $alias );
16161616 }
16171617 }
16181618
Property changes on: branches/wmf/1.17wmf1/includes/db/Database.php
___________________________________________________________________
Modified: svn:mergeinfo
16191619 Merged /trunk/phase3/includes/db/Database.php:r80837,81612,81615,81657,81674,81689
Index: branches/wmf/1.17wmf1/includes/DefaultSettings.php
@@ -434,7 +434,7 @@
435435 $wgAllowCopyUploads = false;
436436 /**
437437 * Allow asynchronous copy uploads.
438 - * This feature is experimental.
 438+ * This feature is experimental is broken as of r81612.
439439 */
440440 $wgAllowAsyncCopyUploads = false;
441441
Property changes on: branches/wmf/1.17wmf1/includes/DefaultSettings.php
___________________________________________________________________
Modified: svn:mergeinfo
442442 Merged /trunk/phase3/includes/DefaultSettings.php:r80837,81612,81615,81657,81674,81689

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80837$wgNoDBParam is tested in loadWikimediaSettings(), before execute() but after...platonides22:49, 23 January 2011
r81612Per CR r66438 and IRC, revert User::leaveNewMessage for now. Copied the funct...btongminh22:44, 6 February 2011
r81615Follow-up r81612, disable $wgAllowAsyncCopyUploadsbtongminh22:53, 6 February 2011
r81657Per fixme on r77597, change to $this->addQuotes() instead of hardcoded quote ...reedy23:21, 7 February 2011
r81674Fixup fixme set by me on r71627...reedy01:06, 8 February 2011
r81689Fix bug from r73645: setMsgBlobMtime() requires its timestamp parameter to be...tstarling05:33, 8 February 2011

Status & tagging log