[Phpmyadmin-devel] PMA_blowfish_encrypt() and full_str_pad()

Marc Delisle Marc.Delisle at cegepsherbrooke.qc.ca
Tue May 15 14:30:22 CEST 2007


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."

http://terra.di.fct.unl.pt/docs/php/function.str-pad.php.htm
------
So it look like there were (are ?) limits to what we can feed to 
str_pad() as the pad string.

In our case, however, we are using a null "\0" as the padding character; 
I tested it and it works in PHP 5.2.2 but I can't test right now with PHP 4.

There is still a problem when you use str_pad() to pad with a string 
like  

  echo str_pad('abc',100," ",1);

the result ends with the "&" character.




More information about the Developers mailing list