Corrected spelling error
[lhc/web/wiklou.git] / includes / EditPage.php
index 2c98ed6..21dae85 100644 (file)
@@ -62,6 +62,7 @@ class EditPage {
        }
 
        function importFormData( &$request ) {
+               global $wgIsMySQL, $wgIsPg;
                # These fields need to be checked for encoding.
                # Also remove trailing whitespace, but don't remove _initial_
                # whitespace from the text boxes. This may be significant formatting.
@@ -70,7 +71,12 @@ class EditPage {
                $this->summary = trim( $request->getText( "wpSummary" ) );
 
                $this->edittime = $request->getVal( 'wpEdittime' );
-               if( !preg_match( '/^\d{14}$/', $this->edittime ) ) $this->edittime = "";
+               if ($wgIsMySQL) 
+                       if( !preg_match( '/^\d{14}$/', $this->edittime )) $this->edittime = "";
+               if ($wgIsPg)
+                       if ( !preg_match( '/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d$/', 
+                               $this->edittime ))
+                               $this->edittime = "";
 
                $this->preview = $request->getCheck( 'wpPreview' );
                $this->save = $request->wasPosted() && !$this->preview;
@@ -388,6 +394,7 @@ class EditPage {
                                        $wgOut->addHTML($previewhead);
                                        $wgOut->addHTML($previewHTML);
                                }
+                               $wgOut->addCategoryLinks($parserOutput->getCategoryLinks());
                                $wgOut->addLanguageLinks($parserOutput->getLanguageLinks());
                                $wgOut->addHTML( "<br style=\"clear:both;\" />\n" );
                        }
@@ -425,7 +432,7 @@ htmlspecialchars( $wgLang->recodeForEdit( $this->textbox1 ) ) .
 <input tabindex='6' id='wpSave' type='submit' value=\"{$prev}\" name=\"wpPreview\" accesskey=\"".wfMsg('accesskey-preview')."\"".
 " title=\"".wfMsg('tooltip-preview')."\"/>
 <em>{$cancel}</em> | <em>{$edithelp}</em>
-<br /><br />{$copywarn}
+<br /><div id=\"editpage-copywarn\">{$copywarn}</div>
 <input type='hidden' value=\"" . htmlspecialchars( $this->section ) . "\" name=\"wpSection\" />
 <input type='hidden' value=\"{$this->edittime}\" name=\"wpEdittime\" />\n" );
 
@@ -538,6 +545,7 @@ htmlspecialchars( $wgLang->recodeForEdit( $this->textbox1 ) ) .
        }
 
        /* private */ function mergeChangesInto( &$text ){
+               global $wgIsPg;
                $oldDate = $this->edittime;
                $res = wfQuery("SELECT cur_text FROM cur WHERE cur_id=" .
                        $this->mTitle->getArticleID() . " FOR UPDATE", DB_WRITE);
@@ -546,7 +554,8 @@ htmlspecialchars( $wgLang->recodeForEdit( $this->textbox1 ) ) .
                $yourtext = $obj->cur_text;
                $ns = $this->mTitle->getNamespace();
                $title = wfStrencode( $this->mTitle->getDBkey() );
-               $res = wfQuery("SELECT old_text,old_flags FROM old WHERE old_namespace = $ns AND ".
+               $oldtable=$wgIsPg?'"old"':'old';
+               $res = wfQuery("SELECT old_text,old_flags FROM $oldtable WHERE old_namespace = $ns AND ".
                  "old_title = '{$title}' AND old_timestamp = '{$oldDate}'", DB_WRITE);
                $obj = wfFetchObject($res);
                $oldText = Article::getRevisionText( $obj );