Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24339
Modified Files:
em_cipher.php
Log Message:
In fact, the new hex2bin/bin2hex methods allow to relax precautions taken with slashes et all. Let's simplify it, then.
Index: em_cipher.php
===================================================================
RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_cipher.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** em_cipher.php 4 Nov 2005 22:03:58 -0000 1.6
--- em_cipher.php 5 Nov 2005 01:50:32 -0000 1.7
***************
*** 559,566 ****
// added by Nuttzy - we'll be storing the result in a DB so we need to replace ' with \'
! $encrypted = addslashes($encrypted);
// TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together
! $encrypted = str_replace("\'", 'NUTTICK', $encrypted);
! $encrypted = str_replace("\n", 'NUTLINE', $encrypted);
// NOTE: a cipher of "single'quote" (the cipher is the stuff between the double quotes) has the ' changed
--- 559,566 ----
// added by Nuttzy - we'll be storing the result in a DB so we need to replace ' with \'
! // $encrypted = addslashes($encrypted);
// TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together
! // $encrypted = str_replace("\'", 'NUTTICK', $encrypted);
! // $encrypted = str_replace("\n", 'NUTLINE', $encrypted);
// NOTE: a cipher of "single'quote" (the cipher is the stuff between the double quotes) has the ' changed
***************
*** 569,572 ****
--- 569,573 ----
// same is true for any slashes that get added. The slashes won't actually show up when viewing the DB ;-)
+ // TAKE THREE: Hopefully the new hex2bin/bin2hex methods solve all these problems.
// change encoding for storage (postgres problems with binary string)
$encrypted = $this->bin2hex($encrypted);
***************
*** 580,589 ****
$this->setkey($key);
// decode for use (postgres storage problems with binary string)
$ciphertext = $this->hex2bin($ciphertext);
// TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together
! $ciphertext = str_replace('NUTTICK', "'", $ciphertext);
! $ciphertext = str_replace('NUTLINE', "\n", $ciphertext);
$decrypted = '';
--- 581,591 ----
$this->setkey($key);
+ // TAKE THREE: Hopefully the new hex2bin/bin2hex methods solve all these problems.
// decode for use (postgres storage problems with binary string)
$ciphertext = $this->hex2bin($ciphertext);
// TAKE TWO: the way General Config settings work in phpBB, this isn't sufficient, get rid of the ' all together
! // $ciphertext = str_replace('NUTTICK', "'", $ciphertext);
! // $ciphertext = str_replace('NUTLINE', "\n", $ciphertext);
$decrypted = '';
|