Index: workflow.pages.inc
--- workflow.pages.inc Base (BASE)
+++ workflow.pages.inc Locally Modified (Based On LOCAL)
@@ -15,7 +15,7 @@
   $states_per_page = variable_get('workflow_states_per_page', 20);
   $result = db_query("SELECT sid, state FROM {workflow_states} WHERE status = 1 ORDER BY sid");
   while ($data = db_fetch_object($result)) {
-    $states[$data->sid] = check_plain(t($data->state));
+    $states[$data->sid] = $data->state;
   }
   $deleted_states = array();
   $result = db_query("SELECT sid, state FROM {workflow_states} WHERE status = 0 ORDER BY sid");
@@ -43,18 +43,25 @@
       $state_name = theme('workflow_deleted_state', $deleted_states[$history->sid]);
       $footer_needed = TRUE;
     }
-    else {
+    elseif (isset($states[$history->sid])) {
       // Regular state.
       $state_name = check_plain(t($states[$history->sid]));
     }
+    else {
+      $state_name = t('<unknown state @state-id>', array('@state-id' => $history->sid));
+    }
 
+
     if (isset($deleted_states[$history->old_sid])) {
       $old_state_name = theme('workflow_deleted_state', $deleted_states[$history->old_sid]);
       $footer_needed = TRUE;
     }
-    else {
+    elseif (isset($states[$history->old_sid])) {
       $old_state_name = check_plain(t($states[$history->old_sid]));
     }
+    else {
+      $old_state_name = t('<unknown state @state-id>', array('@state-id' => $history->old_sid));
+    }
     $rows[] = theme('workflow_history_table_row', $history, $old_state_name, $state_name);
   }
   $output .= theme('workflow_history_table', $rows, !empty($footer_needed));
