passed a bad code.
* ApiBase::checkTitleUserPermissions() now takes an options array as its third
parameter. Passing a User object or null is deprecated.
+* The api-feature-usage log channel now has log context. The text message is
+ deprecated and will be removed in the future.
=== Languages updated in 1.33 ===
MediaWiki supports over 350 languages. Many localisations are updated regularly.
Block::isCreateAccountBlocked and Block::isUsertalkEditAllowed to get and set
block properties; use Block::appliesToRight and Block::appliesToUsertalk to
check block behaviour.
+* The api-feature-usage log channel now has log context. The text message is
+ deprecated and will be removed in the future.
=== Other changes in 1.33 ===
* (T201747) Html::openElement() warns if given an element name with a space
*/
public function logFeatureUsage( $feature ) {
$request = $this->getRequest();
- $s = '"' . addslashes( $feature ) . '"' .
- ' "' . wfUrlencode( str_replace( ' ', '_', $this->getUser()->getName() ) ) . '"' .
- ' "' . $request->getIP() . '"' .
- ' "' . addslashes( $request->getHeader( 'Referer' ) ) . '"' .
- ' "' . addslashes( $this->getMain()->getUserAgent() ) . '"';
- wfDebugLog( 'api-feature-usage', $s, 'private' );
+ $ctx = [
+ 'feature' => $feature,
+ // Spaces to underscores in 'username' for historical reasons.
+ 'username' => str_replace( ' ', '_', $this->getUser()->getName() ),
+ 'ip' => $request->getIP(),
+ 'referer' => (string)$request->getHeader( 'Referer' ),
+ 'agent' => $this->getMain()->getUserAgent(),
+ ];
+
+ // Text string is deprecated. Remove (or replace with just $feature) in MW 1.34.
+ $s = '"' . addslashes( $ctx['feature'] ) . '"' .
+ ' "' . wfUrlencode( $ctx['username'] ) . '"' .
+ ' "' . $ctx['ip'] . '"' .
+ ' "' . addslashes( $ctx['referer'] ) . '"' .
+ ' "' . addslashes( $ctx['agent'] ) . '"';
+
+ wfDebugLog( 'api-feature-usage', $s, 'private', $ctx );
}
/**@}*/