"Awjrichards" changed the status of MediaWiki.r111350 to "fixme" and commented
it.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/111350#c31152
Old Status: new
New Status: fixme
Commit summary for MediaWiki.r111350:
fix for bug30377 : add a new parameter to limit the number of characters when
rendering the channel item <description>
Awjrichards's comment:
<pre>
if ( mb_strlen( $str ) > $this->ItemMaxLength ) {
$str = mb_substr( $str, 0,
$this->ItemMaxLength ) . " ...";
}
</pre>
Be careful here - PHP may not necessarily be compiled with mb string support as
it is a non-default extension. Before relying on mb functions, perhaps ensure
they exist with function_exists().
Also, nitpicky style note:
<pre>
+ # Get a maximal length for item texts
80 + switch ( true ) {
81 + case ( isset( $args['item-max-length'] ) ):
82 + $this->ItemMaxLength =
$args['item-max-length'];
83 + break;
84 + case ( isset( $wgRSSItemMaxLength ) ):
85 + $this->ItemMaxLength =
$wgRSSItemMaxLength;
86 + break;
87 + }
88 +
</pre>
Indentation is messed up here. Also, this seems like an unnecessarily more
difficult to read version of using if() {} elseif(){}.
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview