@@ -832,7 +832,8 @@ private function _addcontribution( $option ) {
832
832
$ this ->addSelect (
833
833
[
834
834
'contribution ' => 'SUM(ABS(rc.rc_new_len - rc.rc_old_len)) ' ,
835
- 'contributor ' => 'rc.rc_actor '
835
+ 'contributor ' => 'rc.rc_actor ' ,
836
+ 'contrib_deleted ' => 'rc.rc_deleted ' ,
836
837
]
837
838
);
838
839
@@ -962,6 +963,7 @@ private function _adduser( $option, $tableAlias = '' ) {
962
963
$ this ->addSelect (
963
964
[
964
965
$ tableAlias . 'rev_actor ' ,
966
+ $ tableAlias . 'rev_deleted ' ,
965
967
]
966
968
);
967
969
}
@@ -1150,15 +1152,19 @@ private function _notcategory( $option ) {
1150
1152
* @param mixed $option
1151
1153
*/
1152
1154
private function _createdby ( $ option ) {
1155
+ $ user = $ this ->userFactory ->newFromName ( $ option );
1156
+ if ( $ user ->isHidden () ) {
1157
+ return ;
1158
+ }
1159
+
1153
1160
$ this ->addTable ( 'revision ' , 'creation_rev ' );
1154
1161
$ this ->_adduser ( null , 'creation_rev ' );
1155
1162
1156
1163
$ this ->addWhere ( [
1157
- $ this ->dbr ->addQuotes (
1158
- $ this ->userFactory ->newFromName ( $ option )->getActorId ()
1159
- ) . ' = creation_rev.rev_actor ' ,
1164
+ $ this ->dbr ->addQuotes ( $ user ->getActorId () ) . ' = creation_rev.rev_actor ' ,
1160
1165
'creation_rev.rev_page = page_id ' ,
1161
- 'creation_rev.rev_parent_id = 0 '
1166
+ 'creation_rev.rev_deleted = 0 ' ,
1167
+ 'creation_rev.rev_parent_id = 0 ' ,
1162
1168
] );
1163
1169
}
1164
1170
@@ -1308,12 +1314,17 @@ private function _imageused( $option ) {
1308
1314
* @param mixed $option
1309
1315
*/
1310
1316
private function _lastmodifiedby ( $ option ) {
1317
+ $ user = $ this ->userFactory ->newFromName ( $ option );
1318
+ if ( $ user ->isHidden () ) {
1319
+ return ;
1320
+ }
1321
+
1311
1322
$ this ->addWhere (
1312
- $ this ->dbr ->addQuotes (
1313
- $ this ->userFactory -> newFromName ( $ option )-> getActorId ()
1314
- ) . ' = (SELECT rev_actor FROM ' . $ this ->dbr ->tableName ( 'revision ' ) .
1315
- ' WHERE ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_page=page_id ORDER BY ' .
1316
- $ this ->dbr ->tableName ( 'revision ' ) . '.rev_timestamp DESC LIMIT 1) '
1323
+ $ this ->dbr ->addQuotes ( $ user -> getActorId () ) .
1324
+ ' = (SELECT rev_actor FROM ' . $ this ->dbr -> tableName ( ' revision ' ) .
1325
+ ' WHERE ' . $ this ->dbr ->tableName ( 'revision ' ) . ' .rev_page = page_id ' .
1326
+ ' AND ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_deleted = 0 ' .
1327
+ ' ORDER BY ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_timestamp DESC LIMIT 1) '
1317
1328
);
1318
1329
}
1319
1330
@@ -1676,12 +1687,16 @@ private function _minrevisions( $option ) {
1676
1687
* @param mixed $option
1677
1688
*/
1678
1689
private function _modifiedby ( $ option ) {
1690
+ $ user = $ this ->userFactory ->newFromName ( $ option );
1691
+ if ( $ user ->isHidden () ) {
1692
+ return ;
1693
+ }
1694
+
1679
1695
$ this ->addTable ( 'revision ' , 'change_rev ' );
1680
1696
1681
1697
$ this ->addWhere (
1682
- $ this ->dbr ->addQuotes (
1683
- $ this ->userFactory ->newFromName ( $ option )->getActorId ()
1684
- ) . ' = change_rev.rev_actor AND change_rev.rev_page = page_id '
1698
+ $ this ->dbr ->addQuotes ( $ user ->getActorId () ) .
1699
+ ' = change_rev.rev_actor AND change_rev.rev_deleted = 0 AND change_rev.rev_page = page_id '
1685
1700
);
1686
1701
}
1687
1702
@@ -1714,13 +1729,17 @@ private function _namespace( $option ) {
1714
1729
* @param mixed $option
1715
1730
*/
1716
1731
private function _notcreatedby ( $ option ) {
1732
+ $ user = $ this ->userFactory ->newFromName ( $ option );
1733
+ if ( $ user ->isHidden () ) {
1734
+ return ;
1735
+ }
1736
+
1717
1737
$ this ->addTable ( 'revision ' , 'no_creation_rev ' );
1718
1738
1719
1739
$ this ->addWhere (
1720
- $ this ->dbr ->addQuotes (
1721
- $ this ->userFactory ->newFromName ( $ option )->getActorId ()
1722
- ) . ' != no_creation_rev.rev_actor AND no_creation_rev.rev_page = ' .
1723
- 'page_id AND no_creation_rev.rev_parent_id = 0 '
1740
+ $ this ->dbr ->addQuotes ( $ user ->getActorId () ) .
1741
+ ' != no_creation_rev.rev_actor AND no_creation_rev.rev_deleted = 0 ' .
1742
+ 'AND no_creation_rev.rev_page = page_id AND no_creation_rev.rev_parent_id = 0 '
1724
1743
);
1725
1744
}
1726
1745
@@ -1730,11 +1749,17 @@ private function _notcreatedby( $option ) {
1730
1749
* @param mixed $option
1731
1750
*/
1732
1751
private function _notlastmodifiedby ( $ option ) {
1733
- $ this ->addWhere ( $ this ->dbr ->addQuotes (
1734
- $ this ->userFactory ->newFromName ( $ option )->getActorId ()
1735
- ) . ' != (SELECT rev_actor FROM ' . $ this ->dbr ->tableName ( 'revision ' ) .
1736
- ' WHERE ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_page=page_id ORDER BY ' .
1737
- $ this ->dbr ->tableName ( 'revision ' ) . '.rev_timestamp DESC LIMIT 1) '
1752
+ $ user = $ this ->userFactory ->newFromName ( $ option );
1753
+ if ( $ user ->isHidden () ) {
1754
+ return ;
1755
+ }
1756
+
1757
+ $ this ->addWhere (
1758
+ $ this ->dbr ->addQuotes ( $ user ->getActorId () ) .
1759
+ ' != (SELECT rev_actor FROM ' . $ this ->dbr ->tableName ( 'revision ' ) .
1760
+ ' WHERE ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_page = page_id ' .
1761
+ ' AND ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_deleted = 0 ' .
1762
+ ' ORDER BY ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_timestamp DESC LIMIT 1) '
1738
1763
);
1739
1764
}
1740
1765
@@ -1744,12 +1769,18 @@ private function _notlastmodifiedby( $option ) {
1744
1769
* @param mixed $option
1745
1770
*/
1746
1771
private function _notmodifiedby ( $ option ) {
1747
- $ this ->addWhere ( 'NOT EXISTS (SELECT 1 FROM ' .
1748
- $ this ->dbr ->tableName ( 'revision ' ) . ' WHERE ' . $ this ->dbr ->tableName ( 'revision ' ) .
1749
- '.rev_page=page_id AND ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_actor = ' .
1750
- $ this ->dbr ->addQuotes (
1751
- $ this ->userFactory ->newFromName ( $ option )->getActorId ()
1752
- ) . ' LIMIT 1) '
1772
+ $ user = $ this ->userFactory ->newFromName ( $ option );
1773
+ if ( $ user ->isHidden () ) {
1774
+ return ;
1775
+ }
1776
+
1777
+ $ this ->addWhere (
1778
+ 'NOT EXISTS (SELECT 1 FROM ' .
1779
+ $ this ->dbr ->tableName ( 'revision ' ) .
1780
+ ' WHERE ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_page = page_id ' .
1781
+ ' AND ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_actor = ' . $ this ->dbr ->addQuotes ( $ user ->getActorId () ) .
1782
+ ' AND ' . $ this ->dbr ->tableName ( 'revision ' ) . '.rev_deleted = 0 ' .
1783
+ ' LIMIT 1) '
1753
1784
);
1754
1785
}
1755
1786
0 commit comments