[Easymod-cvs] easymod2/mods/easymod/em_includes em_cipher.php,1.3,1.4 em_ftp.php,1.7,1.8 em_function
Status: Beta
Brought to you by:
wgeric
From: Markus P. <mar...@us...> - 2005-10-31 17:57:27
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12963/mods/easymod/em_includes Modified Files: em_cipher.php em_ftp.php em_functions.php em_modio.php em_schema.php Log Message: A lot of little and not so little bug fixes affecting almost all files of the package. There is still a bit more work left to do on the ACP script to check correct use of stripslashes and also some issues related to the implementation of the new SQL Parser. Note the version number has already been changed to 0.2.2 Index: em_cipher.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_cipher.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** em_cipher.php 11 Jun 2005 23:05:53 -0000 1.3 --- em_cipher.php 31 Oct 2005 17:57:15 -0000 1.4 *************** *** 543,548 **** $encrypted = ''; ! // added by Nuttzy, we want to make sure the password is nice and long so brute forcers won't know if this ! // is a really short pw $plaintext .= $this->filler ; --- 543,548 ---- $encrypted = ''; ! // added by Nuttzy, we want to make sure the password is nice and long so brute forcers won't know if this ! // is a really short pw $plaintext .= $this->filler ; *************** *** 564,582 **** } ! // 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( "\'", "''", $encrypted) ; ! $encrypted = str_replace( "\'", "NUTTICK", $encrypted) ; ! // NOTE: a cipher of "single'quote" (the cipher is the stuff between the double quotes) has the ' changed ! // to \' and again to ''. So the SQL string we generate for the DB looks like "single''quote". But this is ! // 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 ; } --- 564,586 ---- } ! // 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("\'", "''", $encrypted) ; ! $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 ! // to \' and again to ''. So the SQL string we generate for the DB looks like "single''quote". But this is ! // 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) ! if( function_exists('utf8_encode') ) ! { ! $encrypted = utf8_encode($encrypted); ! } ! return $encrypted ; } *************** *** 586,593 **** { // 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) ; $decrypted = ''; --- 590,601 ---- { // decode for use (postgres storage problems) ! if( function_exists('utf8_decode') ) ! { ! $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); ! $ciphertext = str_replace('NUTLINE', "\n", $ciphertext); $decrypted = ''; *************** *** 608,617 **** } ! // added by nuttzy, we need strip off the extra characters we added ! $decrypted = substr( $decrypted, 0, strlen($decrypted) - strlen($this->filler)) ; ! return $decrypted; } } ! ?> --- 616,625 ---- } ! // added by nuttzy, we need strip off the extra characters we added ! $decrypted = substr( $decrypted, 0, strlen($decrypted) - strlen($this->filler)) ; ! return $decrypted; } } ! ?> \ No newline at end of file Index: em_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_functions.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** em_functions.php 29 Jul 2005 17:33:08 -0000 1.16 --- em_functions.php 31 Oct 2005 17:57:15 -0000 1.17 *************** *** 328,332 **** // change subSilver to the current template as appropriate. $cur_template = preg_replace('#templates/(.*?)/.*#i','$1',$file_list[$file_count]->path); ! $search_array = ($cur_template == '') ? $search_array : str_replace('subSilver',$cur_template,$search_array); $line_return = '' ; --- 328,334 ---- // change subSilver to the current template as appropriate. $cur_template = preg_replace('#templates/(.*?)/.*#i','$1',$file_list[$file_count]->path); ! // $search_array = ($cur_template == '') ? $search_array : str_replace('subSilver',$cur_template,$search_array); ! // -=ET=-'s bugfix: http://sourceforge.net/tracker/index.php?func=detail&aid=1261039&group_id=136984&atid=737391 ! $search_array = ($cur_template == $file_list[$file_count]->path) ? $search_array : str_replace('subSilver',$cur_template,$search_array); $line_return = '' ; *************** *** 566,570 **** { $cur_template = preg_replace('#templates/(.*?)/.*#i','$1',$file_list[$file_count]->path); ! $search_fragment = ($cur_template == '') ? $search_fragment : str_replace('subSilver',$cur_template,$search_fragment); $found_fragment = false ; --- 568,574 ---- { $cur_template = preg_replace('#templates/(.*?)/.*#i','$1',$file_list[$file_count]->path); ! // $search_fragment = ($cur_template == '') ? $search_fragment : str_replace('subSilver',$cur_template,$search_fragment); ! // -=ET=-'s bugfix: http://sourceforge.net/tracker/index.php?func=detail&aid=1261039&group_id=136984&atid=737391 ! $search_fragment = ($cur_template == $file_list[$file_count]->path) ? $search_fragment : str_replace('subSilver',$cur_template,$search_fragment); $found_fragment = false ; *************** *** 1313,1316 **** } ! ?> --- 1317,1331 ---- } + // used only for debugging purposes only + /* + function em_vd($mixed, $title = '') + { + ob_start(); + var_dump($mixed); + $content = ob_get_contents(); + ob_end_clean(); + echo '<pre>' . ( !empty($title) ? ($title . ': ') : '' ) . htmlspecialchars($content) . "</pre>\n"; + } + */ ! ?> \ No newline at end of file Index: em_schema.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_schema.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** em_schema.php 21 Jun 2005 05:30:09 -0000 1.8 --- em_schema.php 31 Oct 2005 17:57:15 -0000 1.9 *************** *** 1284,1286 **** } ! ?> --- 1284,1286 ---- } ! ?> \ No newline at end of file Index: em_modio.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_modio.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** em_modio.php 8 Jul 2005 00:22:56 -0000 1.6 --- em_modio.php 31 Oct 2005 17:57:15 -0000 1.7 *************** *** 374,388 **** { // determing the destination path and filename if ($create_command) { ! $to_dir = $script_path . '/' . $install_path . $this->path ; ! $to_file = $this->filename ; } else { ! $to_dir = $script_path . '/' . $install_path . 'processed/' . $this->path ; ! $to_file = $this->filename . '.txt' ; } // leave some breadcrumbs so we can cd back to phpbb_root $return_path = '' ; --- 374,390 ---- { // determing the destination path and filename + $ipath = strpos($install_path, './') === 0 ? substr($install_path, 2) : $install_path; if ($create_command) { ! $to_dir = $script_path . $ipath . $this->path; ! $to_file = $this->filename; } else { ! $to_dir = $script_path . $ipath . 'processed/' . $this->path; ! $to_file = $this->filename . '.txt'; } + // leave some breadcrumbs so we can cd back to phpbb_root $return_path = '' ; *************** *** 692,694 **** ! ?> --- 694,696 ---- ! ?> \ No newline at end of file Index: em_ftp.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_ftp.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** em_ftp.php 10 Jul 2005 22:06:55 -0000 1.7 --- em_ftp.php 31 Oct 2005 17:57:15 -0000 1.8 *************** *** 1432,1434 **** } ! ?> --- 1432,1434 ---- } ! ?> \ No newline at end of file |