X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Frcfeed%2FMachineReadableRCFeedFormatter.php;h=20f88bd97c46ec5fca68bb8f79f4697ca2eff6f1;hb=6fb3e46c6714af329f6feb0f949e203d17b27ea0;hp=519606ca3c6b894d9a5e8970f11a77ab28327950;hpb=96efe0bc6634f42a72b6f18e7a69dce2388e2452;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/rcfeed/MachineReadableRCFeedFormatter.php b/includes/rcfeed/MachineReadableRCFeedFormatter.php index 519606ca3c..20f88bd97c 100644 --- a/includes/rcfeed/MachineReadableRCFeedFormatter.php +++ b/includes/rcfeed/MachineReadableRCFeedFormatter.php @@ -40,7 +40,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter { public function getLine( array $feed, RecentChange $rc, $actionComment ) { global $wgCanonicalServer, $wgServerName, $wgScriptPath; - $packet = array( + $packet = [ // Usually, RC ID is exposed only for patrolling purposes, // but there is no real reason not to expose it in other cases, // and I can see how this may be potentially useful for clients. @@ -52,7 +52,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter { 'timestamp' => (int)wfTimestamp( TS_UNIX, $rc->getAttribute( 'rc_timestamp' ) ), 'user' => $rc->getAttribute( 'rc_user_text' ), 'bot' => (bool)$rc->getAttribute( 'rc_bot' ), - ); + ]; if ( isset( $feed['channel'] ) ) { $packet['channel'] = $feed['channel']; @@ -70,19 +70,19 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter { switch ( $type ) { case RC_EDIT: - $packet['length'] = array( + $packet['length'] = [ 'old' => $rc->getAttribute( 'rc_old_len' ), 'new' => $rc->getAttribute( 'rc_new_len' ) - ); - $packet['revision'] = array( + ]; + $packet['revision'] = [ 'old' => $rc->getAttribute( 'rc_last_oldid' ), 'new' => $rc->getAttribute( 'rc_this_oldid' ) - ); + ]; break; case RC_NEW: - $packet['length'] = array( 'old' => null, 'new' => $rc->getAttribute( 'rc_new_len' ) ); - $packet['revision'] = array( 'old' => null, 'new' => $rc->getAttribute( 'rc_this_oldid' ) ); + $packet['length'] = [ 'old' => null, 'new' => $rc->getAttribute( 'rc_new_len' ) ]; + $packet['revision'] = [ 'old' => null, 'new' => $rc->getAttribute( 'rc_this_oldid' ) ]; break; case RC_LOG: @@ -90,9 +90,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter { $packet['log_type'] = $rc->getAttribute( 'rc_log_type' ); $packet['log_action'] = $rc->getAttribute( 'rc_log_action' ); if ( $rc->getAttribute( 'rc_params' ) ) { - wfSuppressWarnings(); - $params = unserialize( $rc->getAttribute( 'rc_params' ) ); - wfRestoreWarnings(); + $params = $rc->parseParams(); if ( // If it's an actual serialised false... $rc->getAttribute( 'rc_params' ) == serialize( false ) || @@ -100,7 +98,7 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter { $params !== false ) { // From ApiQueryLogEvents::addLogParams - $logParams = array(); + $logParams = []; // Keys like "4::paramname" can't be used for output so we change them to "paramname" foreach ( $params as $key => $value ) { if ( strpos( $key, ':' ) === false ) {