[TYPO3-core] RFC#15562: Bug/Nobrainer: PHP warning str_pad() in t3lib_div

Steffen Gebert steffen at steffen-gebert.de
Sun Sep 5 16:21:02 CEST 2010


 > Type: Bug, Nobrainer
 > Branches: Trunk, 4-4
 >
 > Problem:
 > A PHP warning is thrown as str_pad function is called with 4 
paramters, where 4th parameter is given as string instead of constant.

Hi Markus,

 > I changed some more lines, but I didn't check if all of them are
 > now CGL compliant.

Please avoid adjusting CGL for untouched lines, only adjust it for 
already changed lines. This makes patches easier to read - especially 
when you're searching for changes only consisting of two "'" ;-)

Also it the error was hard to reproduce, because I first had to find out 
that this only happens, when you compare against a network in CIDR 
notation (a.b.c.d/netmask) like 192.168.1.0/24 and I also couldn't 
observe this error through normal usage. Manually calling
 > t3lib_div::cmpIP('88.1.1.1',
 >   $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']);
did this job.

Please remember that patches have to be also tested while review - so 
you can ease this for you reviewers by providing easy step-by-step 
description "how to reproduce".

Attached v3, which only includes the two neccessary changes.

+1 by reading and testing

Kind regards
Steffen

-- 
Steffen Gebert
TYPO3 Core Team Member
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 15562_v3.diff
Type: text/x-diff
Size: 694 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100905/bd93add2/attachment.diff>


More information about the TYPO3-team-core mailing list