(bug 42814) Fix the visibility of action=query&list=abuselog

Made prop=details invisible for hidden filters if the current
user isn't allowed to see that. Visibility should match the web
interface now.

Change-Id: I2cd682a2ec298473e5398fbf20d850b710f4e93a
This commit is contained in:
Marius Hoch 2012-12-18 23:02:16 +01:00
parent 7a21a8f76a
commit ad9f60a9d3

View file

@ -158,11 +158,14 @@ class ApiQueryAbuseLog extends ApiQueryBase {
$entry['timestamp'] = $ts->getTimestamp( TS_ISO_8601 );
}
if ( $fld_details ) {
$vars = AbuseFilter::loadVarDump( $row->afl_var_dump );
if ( $vars instanceof AbuseFilterVariableHolder ) {
$entry['details'] = $vars->exportAllVars();
} else {
$entry['details'] = array_change_key_case( $vars, CASE_LOWER );
$entry['details'] = array();
if ( !AbuseFilter::filterHidden( $row->afl_filter ) || SpecialAbuseLog::canSeePrivate() ) {
$vars = AbuseFilter::loadVarDump( $row->afl_var_dump );
if ( $vars instanceof AbuseFilterVariableHolder ) {
$entry['details'] = $vars->exportAllVars();
} else {
$entry['details'] = array_change_key_case( $vars, CASE_LOWER );
}
}
}