Reduced some master queries via Revision::READ_NORMAL.
[lhc/web/wiklou.git] / includes / WikiPage.php
index 764a831..a4e1d8d 100644 (file)
@@ -891,10 +891,10 @@ class WikiPage extends Page implements IDBAccessObject {
                $tables = array( 'revision', 'user' );
 
                $fields = array(
-                       'rev_user as user_id',
-                       'rev_user_text AS user_name',
+                       'user_id' => 'rev_user',
+                       'user_name' => 'rev_user_text',
                        $realNameField,
-                       'MAX(rev_timestamp) AS timestamp',
+                       'timestamp' => 'MAX(rev_timestamp)',
                );
 
                $conds = array( 'rev_page' => $this->getId() );
@@ -1788,9 +1788,9 @@ class WikiPage extends Page implements IDBAccessObject {
                                        wfDebug( __METHOD__ . ": invalid username\n" );
                                } elseif ( User::isIP( $shortTitle ) ) {
                                        // An anonymous user
-                                       $other->setNewtalk( true );
+                                       $other->setNewtalk( true, $revision );
                                } elseif ( $other->isLoggedIn() ) {
-                                       $other->setNewtalk( true );
+                                       $other->setNewtalk( true, $revision );
                                } else {
                                        wfDebug( __METHOD__ . ": don't need to notify a nonexistent user\n" );
                                }
@@ -2078,11 +2078,8 @@ class WikiPage extends Page implements IDBAccessObject {
         * Deletes the article with database consistency, writes logs, purges caches
         *
         * @param $reason string delete reason for deletion log
-        * @param $suppress int bitfield
-        *      Revision::DELETED_TEXT
-        *      Revision::DELETED_COMMENT
-        *      Revision::DELETED_USER
-        *      Revision::DELETED_RESTRICTED
+        * @param $suppress boolean suppress all revisions and log the deletion in
+        *        the suppression log instead of the deletion log
         * @param $id int article ID
         * @param $commit boolean defaults to true, triggers transaction end
         * @param &$error Array of errors to append to
@@ -2100,13 +2097,11 @@ class WikiPage extends Page implements IDBAccessObject {
         * Back-end article deletion
         * Deletes the article with database consistency, writes logs, purges caches
         *
+        * @since 1.19
+        *
         * @param $reason string delete reason for deletion log
-        * @param $suppress int bitfield
-        *      Revision::DELETED_TEXT
-        *      Revision::DELETED_COMMENT
-        *      Revision::DELETED_USER
-        *      Revision::DELETED_RESTRICTED
-        * @param $id int article ID
+        * @param $suppress boolean suppress all revisions and log the deletion in
+        *        the suppression log instead of the deletion log
         * @param $commit boolean defaults to true, triggers transaction end
         * @param &$error Array of errors to append to
         * @param $user User The deleting user
@@ -2388,7 +2383,7 @@ class WikiPage extends Page implements IDBAccessObject {
                                array( /* WHERE */
                                        'rc_cur_id' => $current->getPage(),
                                        'rc_user_text' => $current->getUserText(),
-                                       "rc_timestamp > '{$s->rev_timestamp}'",
+                                       'rc_timestamp > ' . $dbw->addQuotes( $s->rev_timestamp ),
                                ), __METHOD__
                        );
                }
@@ -2411,6 +2406,9 @@ class WikiPage extends Page implements IDBAccessObject {
                );
                $summary = wfMsgReplaceArgs( $summary, $args );
 
+               # Truncate for whole multibyte characters.
+               $summary = $wgContLang->truncate( $summary, 255 );
+
                # Save
                $flags = EDIT_UPDATE;