[Easymod-cvs] easymod2/mods/easymod/em_includes em_cipher.php,1.1,1.2 em_functions.php,1.2,1.3
Status: Beta
Brought to you by:
wgeric
From: Brendan K. <bk...@us...> - 2005-05-22 00:30:17
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26146/easymod/em_includes Modified Files: em_cipher.php em_functions.php Log Message: Fixing an encoding issue with Postgre Index: em_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** em_functions.php 1 May 2005 07:22:01 -0000 1.2 --- em_functions.php 22 May 2005 00:29:37 -0000 1.3 *************** *** 1026,1029 **** --- 1026,1033 ---- echo sprintf( $lang['EM_err_insert'], $config_name) . "<br>\n" ; echo "sql=[" . htmlspecialchars($sql) . "]<br>\n" ; + // Debugging + $sql_error = $db->sql_error(); + echo $sql_error['message']; + exit ; } *************** *** 1046,1049 **** --- 1050,1057 ---- echo sprintf( $lang['EM_err_update'], $config_name) . "<br>\n" ; echo "sql=[" . htmlspecialchars($sql) . "]<br>\n" ; + // Debugging + $sql_error = $db->sql_error(); + echo $sql_error['message']; + exit ; } Index: em_cipher.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_cipher.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** em_cipher.php 24 Apr 2005 14:59:53 -0000 1.1 --- em_cipher.php 22 May 2005 00:29:37 -0000 1.2 *************** *** 574,577 **** --- 574,581 ---- // all just so the string is formed properly and what actually gets stored in the DB is "single'quote". The // same is true for any slashes that get added. The slashes won't actually show up when viewing the DB ;-) + + // change encoding for storage (postgres problems) + $encrypted = utf8_encode($encrypted); + return $encrypted ; } *************** *** 581,584 **** --- 585,591 ---- function decrypt($ciphertext) { + // decode for use (postgres storage problems) + $ciphertext = utf8_decode($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) ; *************** *** 603,606 **** --- 610,614 ---- // added by nuttzy, we need strip off the extra characters we added $decrypted = substr( $decrypted, 0, strlen($decrypted) - strlen($this->filler)) ; + return $decrypted; } |