35 $dbw = $this->getPrimaryDB();
36 $batchSize = $this->getBatchSize();
40 $res = $dbw->newSelectQueryBuilder()
41 ->select( [
'user_id',
'user_password' ] )
43 ->where( $dbw->expr(
'user_id',
'>', $minUserId ) )
45 $dbw->expr(
'user_password', IExpression::LIKE,
new LikeValue(
':A:', $dbw->anyString() ) )
47 ->orderBy(
'user_id' )
49 ->caller( __METHOD__ )
52 if ( $res->numRows() === 0 ) {
56 foreach ( $res as $row ) {
57 $passwordHash = substr( $row->user_password, 3 );
58 if ( strpos( $passwordHash,
':' ) > 0 ) {
59 $dbw->newUpdateQueryBuilder()
61 ->set( [
'user_password' =>
':B:' . $passwordHash ] )
62 ->where( [
'user_id' => $row->user_id ] )
63 ->caller( __METHOD__ )
67 $minUserId = $row->user_id;
71 $this->output(
"Wrongly prefixed user password hashes, if present, have been fixed.\n" );