* (bug 2053) Move comment whitespace trimming from edit page to save;
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 1 Jun 2005 08:18:34 +0000 (08:18 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 1 Jun 2005 08:18:34 +0000 (08:18 +0000)
  leaves the whitespace from the section comment there on preview.

RELEASE-NOTES
includes/EditPage.php
includes/Revision.php

index 30d06b2..4529942 100644 (file)
@@ -233,6 +233,8 @@ Various bugfixes, small features, and a few experimental things:
 * Removed some obsolete UTF-8 converter functions
 * Fix function comment in debug dump of SQL statements
 * (bug 2275) Update search index more or less right on page move
+* (bug 2053) Move comment whitespace trimming from edit page to save;
+  leaves the whitespace from the section comment there on preview.
 
 
 === Caveats ===
index 1aa9b3f..13b4615 100644 (file)
@@ -197,7 +197,7 @@ class EditPage {
                        $this->textbox1  = rtrim( $request->getText( 'wpTextbox1' ) );
                        $this->textbox2  = rtrim( $request->getText( 'wpTextbox2' ) );
                        $this->mMetaData = rtrim( $request->getText( 'metadata'   ) );
-                       $this->summary   =  trim( $request->getText( 'wpSummary'  ) );
+                       $this->summary   =        $request->getText( 'wpSummary'  );
        
                        $this->edittime = $request->getVal( 'wpEdittime' );
                        if( is_null( $this->edittime ) ) {
index b58d50c..cfe29f6 100644 (file)
@@ -232,13 +232,15 @@ class Revision {
                        $this->mId        = isset( $row['id']         ) ? IntVal( $row['id']         ) : null;
                        $this->mPage      = isset( $row['page']       ) ? IntVal( $row['page']       ) : null;
                        $this->mTextId    = isset( $row['text_id']    ) ? IntVal( $row['text_id']    ) : null;
-                       $this->mComment   = isset( $row['comment']    ) ? StrVal( $row['comment']    ) : null;
                        $this->mUserText  = isset( $row['user_text']  ) ? StrVal( $row['user_text']  ) : $wgUser->getName();
                        $this->mUser      = isset( $row['user']       ) ? IntVal( $row['user']       ) : $wgUser->getId();
                        $this->mMinorEdit = isset( $row['minor_edit'] ) ? IntVal( $row['minor_edit'] ) : 0;
                        $this->mTimestamp = isset( $row['timestamp']  ) ? StrVal( $row['timestamp']  ) : wfTimestamp( TS_MW );
                        $this->mDeleted   = isset( $row['deleted']    ) ? IntVal( $row['deleted']    ) : 0;
-                       $this->mText      = isset( $row['text']       ) ? StrVal( $row['text']       ) : null;
+                       
+                       // Enforce spacing trimming on supplied text
+                       $this->mComment   = isset( $row['comment']    ) ?  trim( StrVal( $row['comment'] ) ) : null;
+                       $this->mText      = isset( $row['text']       ) ? rtrim( StrVal( $row['text']    ) ) : null;
                        
                        $this->mTitle     = null; # Load on demand if needed
                        $this->mCurrent   = false;