Add `actor` table and code to start using it
[lhc/web/wiklou.git] / includes / content / ContentHandler.php
index 50cc9b5..eab3afb 100644 (file)
@@ -799,13 +799,13 @@ abstract class ContentHandler {
                }
 
                // New page created
-               if ( $flags & EDIT_NEW && $newContent && $newContent->getSize() > 0 ) {
-                       return 'newpage';
-               }
-
-               // New blank page
-               if ( $flags & EDIT_NEW && $newContent && $newContent->getSize() === 0 ) {
-                       return 'newblank';
+               if ( $flags & EDIT_NEW && $newContent ) {
+                       if ( $newContent->getSize() === 0 ) {
+                               // New blank page
+                               return 'newblank';
+                       } else {
+                               return 'newpage';
+                       }
                }
 
                // Removing more than 90% of the page
@@ -986,13 +986,17 @@ abstract class ContentHandler {
 
                // Find out if there was only one contributor
                // Only scan the last 20 revisions
-               $res = $dbr->select( 'revision', 'rev_user_text',
+               $revQuery = Revision::getQueryInfo();
+               $res = $dbr->select(
+                       $revQuery['tables'],
+                       [ 'rev_user_text' => $revQuery['fields']['rev_user_text'] ],
                        [
                                'rev_page' => $title->getArticleID(),
                                $dbr->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0'
                        ],
                        __METHOD__,
-                       [ 'LIMIT' => 20 ]
+                       [ 'LIMIT' => 20 ],
+                       $revQuery['joins']
                );
 
                if ( $res === false ) {