Update of /cvsroot/easymod/easymod2/mods/easymod/includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7072/mods/easymod/includes
Modified Files:
admin_easymod.php.txt
Log Message:
IN-LINE FINDs preceeding INCREMENTs now return errors as appropriate.
Index: admin_easymod.php.txt
===================================================================
RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** admin_easymod.php.txt 10 Jul 2005 22:10:01 -0000 1.23
--- admin_easymod.php.txt 15 Jul 2005 05:21:25 -0000 1.24
***************
*** 1961,1972 ****
$inc_data[2] = isset($inc_data[2]) ? $inc_data[2] : 1;
! // perform the increment as appropriate
! for ( $file = 0; $file < count($file_list); $file++ )
{
for ( $j = 0; $j < count($find_array); $j++ )
{
$increment_search = ($search_fragment != '') ? $search_fragment : $search_array[$j];
! $find_array[$file][$j] = increment_wildcard($inc_data[1], $inc_data[2], $increment_search, $find_array[$file][$j]);
}
}
}
--- 1961,2021 ----
$inc_data[2] = isset($inc_data[2]) ? $inc_data[2] : 1;
! // perform the increment / throw an error as appropriate
! for ( $file_count = 0; $file_count < count($file_list); $file_count++ )
{
for ( $j = 0; $j < count($find_array); $j++ )
{
$increment_search = ($search_fragment != '') ? $search_fragment : $search_array[$j];
! $result = increment_wildcard($inc_data[1], $inc_data[2], $increment_search, $find_array[$file_count][$j]);
! if ($result !== false)
! {
! $find_array[$file_count][$j] = $result;
! break;
! }
}
+ if ($j == count($find_array))
+ {
+ // halt if this is an english lang file
+ if (strstr( $file_list[$file_count]->path, 'language/lang_english'))
+ {
+ $file_list[$file_count]->err_msg = '<b>' . $lang['EM_err_critical_error'] . '</b><br /><br />' ;
+ $err_level = FIND_FAIL_CRITICAL ;
+ }
+
+ // halt if this is a subsilver style file
+ else if (strstr( $file_list[$file_count]->path, 'templates/subSilver'))
+ {
+ $file_list[$file_count]->err_msg = '<b>' . $lang['EM_err_critical_error'] . '</b><br /><br />' ;
+ $err_level = FIND_FAIL_CRITICAL ;
+ }
+
+ // if a different lang, then allow to continue processing
+ else if (strstr( $file_list[$file_count]->path, 'language/lang_'))
+ {
+ $file_list[$file_count]->err_msg = '<b>' . $lang['EM_err_warning'] . '</b><br /><br />' ;
+ $err_level = FIND_FAIL_OK ;
+ }
+
+ // if a different style file, then allow to continue processing
+ else if (strstr( $file_list[$file_count]->path, 'templates/'))
+ {
+ $file_list[$file_count]->err_msg = '<b>' . $lang['EM_err_warning'] . '</b><br /><br />' ;
+ $err_level = FIND_FAIL_OK ;
+ }
+
+ // any other file then halt processing
+ else
+ {
+ $file_list[$file_count]->err_msg = '<b>' . $lang['EM_err_critical_error'] . '</b><br /><br />' ;
+ $err_level = FIND_FAIL_CRITICAL ;
+ }
+ $file_list[$file_count]->err_msg .= sprintf( $lang['EM_err_ifind_fail'], $file_list[$file_count]->path . trim($file_list[$file_count]->filename)) . ':<br /><br />' . htmlspecialchars($search_fragment) . "<br />\n" ;
+ }
+ }
+ // display any errors; if it was critical, terminate processing; if warn, remove file from list
+ // the command will also close the files that we were writing
+ if ( handle_error( $err_level, $file_list, $commands[$i]['line'], true, $find_array))
+ {
+ break ;
}
}
|