Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -1181,21 +1181,28 @@ |
1182 | 1182 | */ |
1183 | 1183 | public static function getUserParams( $uid ) { |
1184 | 1184 | $dbw = wfGetDB( DB_MASTER ); |
1185 | | - $row = $dbw->selectRow( 'flaggedrevs_promote', 'frp_user_params', |
| 1185 | + $row = $dbw->selectRow( 'flaggedrevs_promote', |
| 1186 | + 'frp_user_params', |
1186 | 1187 | array( 'frp_user_id' => $uid ), |
1187 | | - __METHOD__ ); |
| 1188 | + __METHOD__ |
| 1189 | + ); |
1188 | 1190 | # Parse params |
1189 | | - $params = array(); |
| 1191 | + $p = array(); // init |
1190 | 1192 | if( $row ) { |
1191 | 1193 | $flatPars = explode( "\n", trim($row->frp_user_params) ); |
1192 | 1194 | foreach( $flatPars as $pair ) { |
1193 | 1195 | $m = explode( '=', trim($pair), 2 ); |
1194 | 1196 | $key = $m[0]; |
1195 | 1197 | $value = isset($m[1]) ? $m[1] : null; |
1196 | | - $params[$key] = $value; |
| 1198 | + $p[$key] = $value; |
1197 | 1199 | } |
1198 | 1200 | } |
1199 | | - return $params; |
| 1201 | + // Initialize fields as needed... |
| 1202 | + if( !isset($p['uniqueContentPages']) ) $p['uniqueContentPages'] = ''; |
| 1203 | + if( !isset($p['totalContentEdits']) ) $p['totalContentEdits'] = 0; |
| 1204 | + if( !isset($p['editComments']) ) $p['editComments'] = 0; |
| 1205 | + if( !isset($p['revertedEdits']) ) $p['revertedEdits'] = 0; |
| 1206 | + return $p; |
1200 | 1207 | } |
1201 | 1208 | |
1202 | 1209 | /** |