r23987 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23986‎ | r23987 | r23988 >
Date:05:40, 11 July 2007
Author:simetrical
Status:old
Tags:
Comment:
PHP typing strikes again! Padding parser functions now work with strings like '0' that evaluate to false.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/CoreParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CoreParserFunctions.php
@@ -161,7 +161,7 @@
162162 static function pad( $string = '', $length = 0, $char = 0, $direction = STR_PAD_RIGHT ) {
163163 $length = min( max( $length, 0 ), 500 );
164164 $char = substr( $char, 0, 1 );
165 - return ( $string && (int)$length > 0 && strlen( trim( (string)$char ) ) > 0 )
 165+ return ( $string !== '' && (int)$length > 0 && strlen( trim( (string)$char ) ) > 0 )
166166 ? str_pad( $string, $length, (string)$char, $direction )
167167 : $string;
168168 }
Index: trunk/phase3/RELEASE-NOTES
@@ -275,6 +275,7 @@
276276 the intended skin directly in the URL.
277277 * (bug 9903) Don't mark redirects in categories as stubs
278278 * (bug 6965) Cannot include "Template:R" with {{R}} (magic word conflict)
 279+* Padding parser functions now work with strings like '0' that evaluate to false
279280
280281 == API changes since 1.10 ==
281282

Follow-up revisions

RevisionCommit summaryAuthorDate
r24096Merged revisions 23910-24094 via svnmerge from...david22:38, 14 July 2007

Status & tagging log