[Phpmyadmin-devel] PMA_blowfish_encrypt() and full_str_pad()
Sebastian Mendel
lists at sebastianmendel.de
Tue May 15 14:44:08 CEST 2007
Marc Delisle schrieb:
> Sebastian Mendel a écrit :
>> Hi,
>>
>> what is the difference between PHP:str_pad() and phpMyAdmin:full_str_pad()?
>>
>> used in PMA_blowfish_encrypt()
>>
>
> full_str_pad() comes from a comment in the PHP manual for str_pad(). I
> realize that on php.net' manual, the comment is no longer intact but see
> here the original comment:
>
> "In a lot of cases you're better off using str_repeat if you want to use
> something like - it repeats the entire string."
ok, i understand,
so it is not really a 'pad' function but more a add string x-times to
another string function
the question for us is does str_pad treat '\0' as single char or string ...
imho it should be a single char and work with str_pad
simplest testcase is
$string = 'string';
$pad = '\0';
echo (strlen($string . $pad) === strlen(str_pad($string, strlen($string) +
1, $pad)));
--
Sebastian Mendel
www.sebastianmendel.de
More information about the Developers
mailing list