Last modified: 2006-08-21 11:08:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 7081 - PHP warning with error_reporting(E_ALL) on empty padding input to {{padleft}} / {{padright}}
PHP warning with error_reporting(E_ALL) on empty padding input to {{padleft}}...
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Low minor (vote)
: ---
Assigned To: Rob Church
Depends on:
  Show dependency treegraph
Reported: 2006-08-21 05:24 UTC by Nick Jenkins
Modified: 2006-08-21 11:08 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Nick Jenkins 2006-08-21 05:24:11 UTC
Minor PHP warning with string padding, wiki text is:

HTML output on a wiki with error_reporting(E_ALL) includes:
<b>Warning</b>:  str_pad() [<a href='function.str-pad'>function.str-pad</a>]:
Padding string cannot be empty. in
<b>/var/www/hosts/mediawiki/phase3/includes/CoreParserFunctions.php</b> on line
<b>155</b><br />

Maybe just return $string when the padding value is empty? e.g. something
roughly like:
function padright( $parser, $string = '', $length = 0, $char = 0 ) {
if ((string)$char) {
return str_pad( $string, $length, (string)$char, STR_PAD_RIGHT );
} else {
return $string;

... or perhaps in this situation just set it to a generally acceptable default:
if (!(string)$char) $char = "0";
return str_pad( $string, $length, (string)$char, STR_PAD_RIGHT );
Comment 1 Rob Church 2006-08-21 11:08:27 UTC
Fixed in SVN trunk, r16152.

Note You need to log in before you can comment on or make changes to this bug.