--- guestbook.module.orig	2010-05-18 21:05:15.000000000 -0400
+++ guestbook.module	2010-05-18 21:07:37.000000000 -0400
@@ -807,18 +807,18 @@ function theme_guestbook_entry($uid, $en
         $links['delete'] = array(
           'title' => t('Delete entry'),
           'href' => guestbook_path($uid) .'/delete/'. $entry['id'],
-          'query' => 'destination='. url($_GET['q']) . $pager,
+          'query' => drupal_get_destination() . $pager,
         );
         $links['edit'] = array(
           'title' => t('Edit entry'),
           'href' => guestbook_path($uid) .'/edit/'. $entry['id'],
-          'query' => 'destination='. url($_GET['q']) . $pager,
+          'query' => drupal_get_destination() . $pager,
         );
       }
       $links['comment'] = array(
         'title' => $entry['comment'] == '' ? t('Add comment') : t('Edit comment'),
         'href' => guestbook_path($uid) .'/comment/'. $entry['id'],
-        'query' => 'destination='. url($_GET['q']) . $pager,
+        'query' => drupal_get_destination() . $pager,
         'fragment' => 'comment-entry',
       );
       $output .= theme('links', $links, array('class' => 'guestbook-links'));
