Remove BOM from cleanupPreferences
[lhc/web/wiklou.git] / maintenance / cleanupPreferences.php
1 <?php
2 /**
3 * Description: This script takes $wgHiddenPrefs and removes their preference from the DB. [[bugzilla:30976]]
4 * @author TyA <tya.wiki@gmail.com>
5 * @ingroup Maintenance
6 */
7
8 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
9
10 class CleanupPreferences extends Maintenance {
11 public function execute() {
12 global $wgHiddenPrefs;
13
14 $dbw = wfGetDB( DB_MASTER );
15 $dbw->begin();
16 foreach( $wgHiddenPrefs as $item ) {
17 $dbw->delete(
18 'user_properties',
19 array( 'up_property' => $item ),
20 __METHOD__
21 );
22 };
23 $dbw->commit();
24 $this->output( "Finished!\n" );
25 }
26 }
27
28 $maintClass = 'CleanupPreferences'; // Tells it to run the class
29 require_once( RUN_MAINTENANCE_IF_MAIN );