From: Sam Wilson Date: Fri, 6 Apr 2018 01:44:50 +0000 (+0800) Subject: Remove gadget special-case from preferences cleanup X-Git-Tag: 1.31.0-rc.0~63^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=6717ea5c7db15e963a782f6ccd4e540a0a624e4e;p=lhc%2Fweb%2Fwiklou.git Remove gadget special-case from preferences cleanup Avoiding deletion of 'gadget-' preferences is now done in the Gadgets extension via the hook. Bug: T188966 Change-Id: I81a070986b6e76a2fcec52617b59e9528e52eba2 Depends-On: I5627f014827fdbf266eb7fdb00a446f81a0c3458 --- diff --git a/maintenance/cleanupPreferences.php b/maintenance/cleanupPreferences.php index 33cc0ca27d..b24d72ddda 100644 --- a/maintenance/cleanupPreferences.php +++ b/maintenance/cleanupPreferences.php @@ -39,7 +39,7 @@ class CleanupPreferences extends Maintenance { $this->addOption( 'dry-run', 'Print debug info instead of actually deleting' ); $this->addOption( 'hidden', 'Drop hidden preferences ($wgHiddenPrefs)' ); $this->addOption( 'unknown', - 'Drop unknown preferences (not in $wgDefaultUserOptions or a gadget or userjs)' ); + 'Drop unknown preferences (not in $wgDefaultUserOptions or prefixed with "userjs-")' ); // TODO: actually implement this // $this->addOption( 'bogus', 'Drop preferences that have invalid/unaccepted values' ); } @@ -84,11 +84,9 @@ class CleanupPreferences extends Maintenance { } } - // Remove unknown preferences. Special-case gadget- and userjs- as we can't - // control those names. + // Remove unknown preferences. Special-case 'userjs-' as we can't control those names. if ( $unknown ) { $where = [ - 'up_property NOT' . $dbw->buildLike( 'gadget-', $dbw->anyString() ), 'up_property NOT' . $dbw->buildLike( 'userjs-', $dbw->anyString() ), 'up_property NOT IN (' . $dbw->makeList( array_keys( $wgDefaultUserOptions ) ) . ')', ];