Merge "Save pages content in the default format of their content type"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 16 Sep 2014 17:43:45 +0000 (17:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 16 Sep 2014 17:43:45 +0000 (17:43 +0000)
1  2 
includes/EditPage.php

diff --combined includes/EditPage.php
@@@ -1892,8 -1892,14 +1892,14 @@@ class EditPage 
                        ( ( $this->minoredit && !$this->isNew ) ? EDIT_MINOR : 0 ) |
                        ( $bot ? EDIT_FORCE_BOT : 0 );
  
-               $doEditStatus = $this->mArticle->doEditContent( $content, $this->summary, $flags,
-                                                                                                               false, null, $this->contentFormat );
+               $doEditStatus = $this->mArticle->doEditContent(
+                       $content,
+                       $this->summary,
+                       $flags,
+                       false,
+                       null,
+                       $content->getDefaultFormat()
+               );
  
                if ( !$doEditStatus->isOK() ) {
                        // Failure from doEdit()
@@@ -3226,7 -3232,6 +3232,7 @@@ HTM
                        $attrs['class'] = 'mw-ui-button mw-ui-quiet';
                }
                $edithelp = Html::element( 'a', $attrs, wfMessage( 'edithelp' )->text() ) .
 +                      wfMessage( 'word-separator' )->escaped() .
                        wfMessage( 'newwindow' )->parse();
  
                $wgOut->addHTML( "      <span class='cancelLink'>{$cancel}</span>\n" );
         * @return string
         */
        static function getEditToolbar() {
 -              global $wgStylePath, $wgContLang, $wgLang, $wgOut;
 +              global $wgContLang, $wgOut;
                global $wgEnableUploads, $wgForeignFileRepos;
  
                $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos );
  
                /**
                 * $toolarray is an array of arrays each of which includes the
 -               * filename of the button image (without path), the opening
 -               * tag, the closing tag, optionally a sample text that is
 +               * opening tag, the closing tag, optionally a sample text that is
                 * inserted between the two when no selection is highlighted
                 * and.  The tip text is shown when the user moves the mouse
                 * over the button.
 +               *
 +               * Images are defined in ResourceLoaderEditToolbarModule.
                 */
                $toolarray = array(
                        array(
 -                              'image'  => $wgLang->getImageFile( 'button-bold' ),
                                'id'     => 'mw-editbutton-bold',
                                'open'   => '\'\'\'',
                                'close'  => '\'\'\'',
                                'tip'    => wfMessage( 'bold_tip' )->text(),
                        ),
                        array(
 -                              'image'  => $wgLang->getImageFile( 'button-italic' ),
                                'id'     => 'mw-editbutton-italic',
                                'open'   => '\'\'',
                                'close'  => '\'\'',
                                'tip'    => wfMessage( 'italic_tip' )->text(),
                        ),
                        array(
 -                              'image'  => $wgLang->getImageFile( 'button-link' ),
                                'id'     => 'mw-editbutton-link',
                                'open'   => '[[',
                                'close'  => ']]',
                                'tip'    => wfMessage( 'link_tip' )->text(),
                        ),
                        array(
 -                              'image'  => $wgLang->getImageFile( 'button-extlink' ),
                                'id'     => 'mw-editbutton-extlink',
                                'open'   => '[',
                                'close'  => ']',
                                'tip'    => wfMessage( 'extlink_tip' )->text(),
                        ),
                        array(
 -                              'image'  => $wgLang->getImageFile( 'button-headline' ),
                                'id'     => 'mw-editbutton-headline',
                                'open'   => "\n== ",
                                'close'  => " ==\n",
                                'tip'    => wfMessage( 'headline_tip' )->text(),
                        ),
                        $imagesAvailable ? array(
 -                              'image'  => $wgLang->getImageFile( 'button-image' ),
                                'id'     => 'mw-editbutton-image',
                                'open'   => '[[' . $wgContLang->getNsText( NS_FILE ) . ':',
                                'close'  => ']]',
                                'tip'    => wfMessage( 'image_tip' )->text(),
                        ) : false,
                        $imagesAvailable ? array(
 -                              'image'  => $wgLang->getImageFile( 'button-media' ),
                                'id'     => 'mw-editbutton-media',
                                'open'   => '[[' . $wgContLang->getNsText( NS_MEDIA ) . ':',
                                'close'  => ']]',
                                'tip'    => wfMessage( 'media_tip' )->text(),
                        ) : false,
                        array(
 -                              'image'  => $wgLang->getImageFile( 'button-nowiki' ),
                                'id'     => 'mw-editbutton-nowiki',
                                'open'   => "<nowiki>",
                                'close'  => "</nowiki>",
                                'tip'    => wfMessage( 'nowiki_tip' )->text(),
                        ),
                        array(
 -                              'image'  => $wgLang->getImageFile( 'button-sig' ),
                                'id'     => 'mw-editbutton-signature',
                                'open'   => '--~~~~',
                                'close'  => '',
                                'tip'    => wfMessage( 'sig_tip' )->text(),
                        ),
                        array(
 -                              'image'  => $wgLang->getImageFile( 'button-hr' ),
                                'id'     => 'mw-editbutton-hr',
                                'open'   => "\n----\n",
                                'close'  => '',
                        }
  
                        $params = array(
 -                              $wgStylePath . '/common/images/' . $tool['image'],
 +                              // Images are defined in ResourceLoaderEditToolbarModule
 +                              false,
                                // Note that we use the tip both for the ALT tag and the TITLE tag of the image.
                                // Older browsers show a "speedtip" type message only for ALT.
                                // Ideally these should be different, realistically they