Project

General

Profile

Actions

Bug #38969

closed

PHP Warning: str_pad() expects parameter 2 to be long, string given

Added by Peter Linzenkirchner over 12 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Frontend
Target version:
-
Start date:
2012-07-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Core: Error handler (FE): PHP Warning: str_pad() expects parameter 2 to be long, string given in /Users/peter/Sites/typo3_src-4.5.17/typo3/sysext/cms/tslib/class.tslib_content.php line 3588

only php 5.3.

PHP: string str_pad ( string $input , int $pad_length ....) 2. option should be a integer.

function prefixComment($str, $conf, $content) {
$parts = explode('|', $str);
$output = LF . str_pad('', $parts[0], TAB) . .....
...
}

$parts[0] is interpreted as string. when i add a type cast the warning disappears:

$output = LF . str_pad('', (int)$parts[0], TAB) . .....
Actions

Also available in: Atom PDF