r53732 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53731‎ | r53732 | r53733 >
Date:23:45, 24 July 2009
Author:demon
Status:deferred
Tags:
Comment:
* Fix last $wgRequest->data usage anywhere in core or SVN extensions \o/
* ( in_array() ) ? true : false is stupid
Modified paths:
  • /trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PlayerStatsGrabber/PlayerStatsGrabber_body.php
@@ -161,9 +161,7 @@
162162 global $wgRequest, $psLogEveryPlayRequestPerUser;
163163 // do the insert into the userPlayerStats table:
164164 $dbr =& wfGetDB( DB_READ );
165 - if ( !isset( $wgRequest->data['cs'] ) || !is_array( $wgRequest->data['cs'] ) ) {
166 - $wgRequest->data['cs'] = array();
167 - }
 165+ $cs = $wgRequest->getArray( 'cs', array() );
168166 // set up insert array:
169167 $insAry = array(
170168 'user_hash' => $wgRequest->getVal( 'uh' ),
@@ -174,19 +172,13 @@
175173 //'b_os' => $wgRequest->getVal( 'b_os' ),
176174 'flash_version' => $wgRequest->getVal( 'fv' ),
177175 'java_version' => $wgRequest->getVal( 'jv' ),
178 - 'html5_video_enabled' => ( in_array( 'videoElement', $wgRequest->data['cs'] ) ) ? true:false,
179 - 'java_enabled' => ( in_array( 'cortado', $wgRequest->data['cs'] ) ) ? true:false,
180 - 'totem_enabled' => ( in_array( 'totem', $wgRequest->data['cs'] ) ) ? true:false,
181 - 'flash_enabled' => ( in_array( 'flash', $wgRequest->data['cs'] ) ) ? true:false,
182 - 'quicktime_enabled' => ( in_array( array( 'quicktime-mozilla', 'quicktime-activex' ),
183 - $wgRequest->data['cs'] )
184 - ) ? true:false,
185 - 'vlc_enabled' => ( in_array( array( 'vlc-mozilla', 'vlc-activex' ),
186 - $wgRequest->data['cs'] )
187 - ) ? true:false,
188 - 'mplayer_enabled' => ( in_array( 'mplayerplug-in',
189 - $wgRequest->data['cs'] )
190 - ) ? true:false
 176+ 'html5_video_enabled' => in_array( 'videoElement', $cs ),
 177+ 'java_enabled' => in_array( 'cortado', $cs ),
 178+ 'totem_enabled' => in_array( 'totem', $cs ),
 179+ 'flash_enabled' => in_array( 'flash', $cs ),
 180+ 'quicktime_enabled' => in_array( array( 'quicktime-mozilla', 'quicktime-activex' ), $cs ),
 181+ 'vlc_enabled' => in_array( array( 'vlc-mozilla', 'vlc-activex' ), $cs ),
 182+ 'mplayer_enabled' => in_array( 'mplayerplug-in', $cs ),
191183 );
192184 // check for user hash (don't collect multiple times for the same user)
193185 // $user_hash =

Status & tagging log