* (bug 20131) PHP Notice: Undfined index: page_latest in includes/ChangesList.php...
[lhc/web/wiklou.git] / includes / EditPage.php
index 73faacc..4aa603b 100644 (file)
@@ -48,6 +48,8 @@ class EditPage {
        var $mMetaData = '';
        var $isConflict = false;
        var $isCssJsSubpage = false;
+       var $isCssSubpage = false;
+       var $isJsSubpage = false;
        var $deletedSinceEdit = false;
        var $formtype;
        var $firsttime;
@@ -427,6 +429,8 @@ class EditPage {
                $this->isConflict = false;
                // css / js subpages of user pages get a special treatment
                $this->isCssJsSubpage      = $this->mTitle->isCssJsSubpage();
+               $this->isCssSubpage        = $this->mTitle->isCssSubpage();
+               $this->isJsSubpage         = $this->mTitle->isJsSubpage();
                $this->isValidCssJsSubpage = $this->mTitle->isValidCssJsSubpage();
 
                # Show applicable editing introductions
@@ -882,7 +886,7 @@ class EditPage {
                        }
 
                        // Run post-section-merge edit filter
-                       if ( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError, $this->summary ) ) ) {
+                       if ( !wfRunHooks( 'EditFilterMerged', array( &$this, $this->textbox1, &$this->hookError, $this->summary ) ) ) {
                                # Error messages etc. could be handled within the hook...
                                wfProfileOut( $fname );
                                return self::AS_HOOK_ERROR;
@@ -1241,13 +1245,15 @@ class EditPage {
                } else {
                        if ( $this->isCssJsSubpage ) {
                                # Check the skin exists
-                               if ( $this->isValidCssJsSubpage ) {
-                                       if ( $this->formtype !== 'preview' ) {
-                                               $wgOut->addWikiMsg( 'usercssjsyoucanpreview' );
-                                       }
-                               } else {
+                               if ( !$this->isValidCssJsSubpage ) {
                                        $wgOut->addWikiMsg( 'userinvalidcssjstitle', $wgTitle->getSkinFromCssJsSubpage() );
                                }
+                               if ( $this->formtype !== 'preview' ) {
+                                       if ( $this->isCssSubpage )
+                                               $wgOut->addWikiMsg( 'usercssyoucanpreview' );
+                                       if ( $this->isJsSubpage )
+                                               $wgOut->addWikiMsg( 'userjsyoucanpreview' );
+                               }
                        }
                }
 
@@ -1403,6 +1409,8 @@ class EditPage {
                                                                                'maxlength' => '200',
                                                                                'tabindex' => '1'
                                                                        ) );
+                       } else {
+                               $summaryhiddens .= Xml::hidden( 'wpIgnoreBlankSummary', true ); # bug 18699
                        }
                        $editsummary = "<div class='editOptions'>\n";
                        global $wgParser;