diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-01-05 23:35:34 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-01-05 23:35:34 +0000 |
commit | c27b62b182dab9ef0f301b2caf94962c59c20909 (patch) | |
tree | ffaccaffca056f2e04e0ebbe065089ec06472659 /modules/watchdog.module | |
parent | f940d8a290aad7fbc18b809e8e86e70562c75bac (diff) | |
download | brdo-c27b62b182dab9ef0f301b2caf94962c59c20909.tar.gz brdo-c27b62b182dab9ef0f301b2caf94962c59c20909.tar.bz2 |
- #41940: Locale string search broken in some cases (and remove some inappropriate db_escape_string() usage)
- #43491: Missing drupal_goto() after saving settings
Diffstat (limited to 'modules/watchdog.module')
-rw-r--r-- | modules/watchdog.module | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/watchdog.module b/modules/watchdog.module index 3bab67c51..4f19dce27 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -71,10 +71,8 @@ function watchdog_overview() { $classes = array(WATCHDOG_NOTICE => 'watchdog-notice', WATCHDOG_WARNING => 'watchdog-warning', WATCHDOG_ERROR => 'watchdog-error'); $names['all'] = t('all messages'); - $queries['all'] = ''; foreach (_watchdog_get_message_types() as $type) { $names[$type] = t('%type messages', array('%type' => t($type))); - $queries[$type] = "WHERE type = '". db_escape_string($type) ."'"; } if (empty($_SESSION['watchdog_overview_filter'])) { @@ -104,8 +102,16 @@ function watchdog_overview() { array('data' => t('User'), 'field' => 'u.name'), array('data' => t('Operations')) ); - $sql = 'SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid '. $queries[$_SESSION['watchdog_overview_filter']] . tablesort_sql($header); - $result = pager_query($sql, 50); + + $sql = "SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid"; + $tablesort = tablesort_sql($header); + $type = $_SESSION['watchdog_overview_filter']; + if ($type != 'all') { + $result = pager_query($sql ." WHERE w.type = '%s'". $tablesort, 50, 0, NULL, $type); + } + else { + $result = pager_query($sql . $tablesort, 50); + } while ($watchdog = db_fetch_object($result)) { $rows[] = array('data' => @@ -127,7 +133,6 @@ function watchdog_overview() { $rows[] = array(array('data' => t('No log messages available.'), 'colspan' => 6)); } - $output .= theme('table', $header, $rows); $output .= theme('pager', NULL, 50, 0, tablesort_pager()); |