Index: trunk/phase3/includes/ProxyTools.php |
— | — | @@ -41,9 +41,12 @@ |
42 | 42 | /** |
43 | 43 | * Returns the browser/OS data from the request header |
44 | 44 | * Note: headers are spoofable |
| 45 | + * |
| 46 | + * @deprecated in 1.19; use $wgRequest->getHeader( 'User-Agent' ) instead. |
45 | 47 | * @return string |
46 | 48 | */ |
47 | 49 | function wfGetAgent() { |
| 50 | + wfDeprecated( __FUNCTION__ ); |
48 | 51 | if( function_exists( 'apache_request_headers' ) ) { |
49 | 52 | // More reliable than $_SERVER due to case and -/_ folding |
50 | 53 | $set = array(); |
Index: trunk/extensions/CheckUser/CheckUser.php |
— | — | @@ -85,6 +85,8 @@ |
86 | 86 | * Saves user data into the cu_changes table |
87 | 87 | */ |
88 | 88 | function efUpdateCheckUserData( $rc ) { |
| 89 | + global $wgRequest; |
| 90 | + |
89 | 91 | // Extract params |
90 | 92 | extract( $rc->mAttribs ); |
91 | 93 | // Get IP |
— | — | @@ -95,7 +97,7 @@ |
96 | 98 | // Our squid XFFs can flood this up sometimes |
97 | 99 | $isSquidOnly = efXFFChainIsSquid( $xff ); |
98 | 100 | // Get agent |
99 | | - $agent = wfGetAgent(); |
| 101 | + $agent = $wgRequest->getHeader( 'User-Agent' ); |
100 | 102 | // Store the log action text for log events |
101 | 103 | // $rc_comment should just be the log_comment |
102 | 104 | // BC: check if log_type and log_action exists |
— | — | @@ -154,13 +156,15 @@ |
155 | 157 | * Saves user data into the cu_changes table |
156 | 158 | */ |
157 | 159 | function efUpdateCUPasswordResetData( $user, $ip, $account ) { |
| 160 | + global $wgRequest; |
| 161 | + |
158 | 162 | // Get XFF header |
159 | 163 | $xff = wfGetForwardedFor(); |
160 | 164 | list( $xff_ip, $trusted ) = efGetClientIPfromXFF( $xff ); |
161 | 165 | // Our squid XFFs can flood this up sometimes |
162 | 166 | $isSquidOnly = efXFFChainIsSquid( $xff ); |
163 | 167 | // Get agent |
164 | | - $agent = wfGetAgent(); |
| 168 | + $agent = $wgRequest->getHeader( 'User-Agent' ); |
165 | 169 | $dbw = wfGetDB( DB_MASTER ); |
166 | 170 | $cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' ); |
167 | 171 | $rcRow = array( |
— | — | @@ -192,7 +196,7 @@ |
193 | 197 | * Saves user data into the cu_changes table |
194 | 198 | */ |
195 | 199 | function efUpdateCUEmailData( $to, $from, $subject, $text ) { |
196 | | - global $wgSecretKey; |
| 200 | + global $wgSecretKey, $wgRequest; |
197 | 201 | if ( !$wgSecretKey || $from->name == $to->name ) { |
198 | 202 | return true; |
199 | 203 | } |
— | — | @@ -207,7 +211,7 @@ |
208 | 212 | // Our squid XFFs can flood this up sometimes |
209 | 213 | $isSquidOnly = efXFFChainIsSquid( $xff ); |
210 | 214 | // Get agent |
211 | | - $agent = wfGetAgent(); |
| 215 | + $agent = $wgRequest->getHeader( 'User-Agent' ); |
212 | 216 | $dbw = wfGetDB( DB_MASTER ); |
213 | 217 | $cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' ); |
214 | 218 | $rcRow = array( |
— | — | @@ -252,6 +256,8 @@ |
253 | 257 | * @return bool |
254 | 258 | */ |
255 | 259 | function efLogUserAccountCreation( $user, $actiontext ) { |
| 260 | + global $wgRequest; |
| 261 | + |
256 | 262 | // Get IP |
257 | 263 | $ip = wfGetIP(); |
258 | 264 | // Get XFF header |
— | — | @@ -260,7 +266,7 @@ |
261 | 267 | // Our squid XFFs can flood this up sometimes |
262 | 268 | $isSquidOnly = efXFFChainIsSquid( $xff ); |
263 | 269 | // Get agent |
264 | | - $agent = wfGetAgent(); |
| 270 | + $agent = $wgRequest->getHeader( 'User-Agent' ); |
265 | 271 | $dbw = wfGetDB( DB_MASTER ); |
266 | 272 | $cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' ); |
267 | 273 | $rcRow = array( |
Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -1267,7 +1267,7 @@ |
1268 | 1268 | |
1269 | 1269 | static function curlreq( $method, $url, $postFields, &$errorMessage, &$info, |
1270 | 1270 | $timeout = true, $toFile = null ) { |
1271 | | - global $wgHTTPTimeout, $wgHTTPProxy, $wgTitle, $wgVersion; |
| 1271 | + global $wgHTTPTimeout, $wgHTTPProxy, $wgTitle, $wgRequest, $wgVersion; |
1272 | 1272 | global $wgCollectionMWServeCert; |
1273 | 1273 | global $wgCollectionVersion; |
1274 | 1274 | |
— | — | @@ -1276,7 +1276,7 @@ |
1277 | 1277 | } |
1278 | 1278 | $c = curl_init( $url ); |
1279 | 1279 | curl_setopt( $c, CURLOPT_PROXY, $wgHTTPProxy ); |
1280 | | - $userAgent = wfGetAgent(); |
| 1280 | + $userAgent = $wgRequest->getHeader( 'User-Agent' ); |
1281 | 1281 | if ( !$userAgent ) { |
1282 | 1282 | $userAgent = "Unknown user agent"; |
1283 | 1283 | } |
Index: trunk/extensions/SignDocument/SignDocumentHelpers.php |
— | — | @@ -375,7 +375,7 @@ |
376 | 376 | $f->mEmail = $wgRequest->getVal( 'email', '' ); |
377 | 377 | |
378 | 378 | $f->mIp = wfGetIp(); |
379 | | - $f->mAgent = wfGetAgent(); |
| 379 | + $f->mAgent = $wgRequest->getHeader( 'User-Agent' ); |
380 | 380 | |
381 | 381 | if ( $wgRequest->getVal( 'anonymous' ) ) $f->mHiddenFields[] = 'realname'; |
382 | 382 | if ( $wgRequest->getVal( 'hideaddress' ) ) $f->mHiddenFields[] = 'address'; |