Index: modules/watchdog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/watchdog.module,v
retrieving revision 1.137
diff -u -r1.137 watchdog.module
--- modules/watchdog.module	24 Jan 2006 08:18:26 -0000	1.137
+++ modules/watchdog.module	25 Jan 2006 20:03:38 -0000
@@ -157,7 +157,8 @@
   $result = db_query('SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = %d', $id);
   if ($watchdog = db_fetch_object($result)) {
     $header = array(t('Type'), t('Date'), t('User'), t('Location'), t('Referrer'), t('Message'), t('Severity'), t('Hostname'));
-    $data = array(t($watchdog->type), format_date($watchdog->timestamp, 'large'), theme('username', $watchdog), l($watchdog->location, $watchdog->location), l($watchdog->referer, $watchdog->referer), $watchdog->message, $severity[$watchdog->severity], $watchdog->hostname);
+    // $watchdog->location returns request_uri() which includes sub folders and query strings after http://www.example.com, this causes broken links so we strip these folders off and only pass the query string to l()
+    $data = array(t($watchdog->type), format_date($watchdog->timestamp, 'large'), theme('username', $watchdog), l($watchdog->location, substr($watchdog->location, strpos($watchdog->location, '?q=') + 3)), l($watchdog->referer, $watchdog->referer), $watchdog->message, $severity[$watchdog->severity], $watchdog->hostname);
     $output = theme('watchdog_event', $header, $data);
   }
   return $output;
