Merge "Fix Postgres support"
[lhc/web/wiklou.git] / includes / specialpage / ChangesListSpecialPage.php
index 7e70df2..09ed3c4 100644 (file)
@@ -973,13 +973,17 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         * @return bool True if any option was reset
         */
        private function fixContradictoryOptions( FormOptions $opts ) {
-               $contradictorySets = [];
-
                $fixed = $this->fixBackwardsCompatibilityOptions( $opts );
 
                foreach ( $this->filterGroups as $filterGroup ) {
                        if ( $filterGroup instanceof ChangesListBooleanFilterGroup ) {
                                $filters = $filterGroup->getFilters();
+
+                               if ( count( $filters ) === 1 ) {
+                                       // legacy boolean filters should not be considered
+                                       continue;
+                               }
+
                                $allInGroupEnabled = array_reduce(
                                        $filters,
                                        function ( $carry, $filter ) use ( $opts ) {
@@ -990,7 +994,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
 
                                if ( $allInGroupEnabled ) {
                                        foreach ( $filters as $filter ) {
-                                               $opts->reset( $filter->getName() );
+                                               $opts[ $filter->getName() ] = false;
                                        }
 
                                        $fixed = true;
@@ -1078,7 +1082,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
 
                // Namespace filtering
                if ( $opts[ 'namespace' ] !== '' ) {
-                       $namespaces = explode( ',', $opts[ 'namespace' ] );
+                       $namespaces = explode( ';', $opts[ 'namespace' ] );
 
                        if ( $opts[ 'associated' ] ) {
                                $associatedNamespaces = array_map(
@@ -1354,7 +1358,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                $aboveNewcomer = $dbr->makeList(
                        [
                                'user_editcount >= ' . intval( $wgLearnerEdits ),
-                               'user_registration <= ' . $dbr->timestamp( $learnerCutoff ),
+                               'user_registration <= ' . $dbr->addQuotes( $dbr->timestamp( $learnerCutoff ) ),
                        ],
                        IDatabase::LIST_AND
                );
@@ -1362,7 +1366,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                $aboveLearner = $dbr->makeList(
                        [
                                'user_editcount >= ' . intval( $wgExperiencedUserEdits ),
-                               'user_registration <= ' . $dbr->timestamp( $experiencedUserCutoff ),
+                               'user_registration <= ' .
+                                       $dbr->addQuotes( $dbr->timestamp( $experiencedUserCutoff ) ),
                        ],
                        IDatabase::LIST_AND
                );