--- knurl.module	2008-03-16 04:20:04.000000000 +0200
+++ knurl.module.6	2008-03-16 04:15:57.000000000 +0200
@@ -66,22 +66,22 @@ function knurl_menu() {
     'access callback'   => 'user_access',
     'access arguments' => array('access knurl'),
     'type'     => MENU_CALLBACK
-  );   
+  );
   return $items;
 }
 
 /**
  * Responds to /knurl/show to list all URL's
  * and /knurl/show/${url} for one
- */ 
+ */
 function knurl_show() {
   $output = '<p>';
   $url_limit = 75;
   $args = func_get_args();
   if (sizeof($args) == 1 ) {
-    $output .= l('show all', 'knurl/show'); 
+    $output .= l('show all', 'knurl/show');
     $res = db_query("SELECT * FROM {knurl} WHERE short_url='%s'", end($args));
-  } 
+  }
   else {
     $output .= '&nbsp;';
     $res = pager_query("SELECT * FROM {knurl} ORDER BY tid DESC", 50);
@@ -94,17 +94,17 @@ function knurl_show() {
     $output .= '<tr><td>'. wordwrap($node->link, $url_limit, "<br/>", true) .'</td><td>';
     $output .= l(_get_server_url() .'/url/'.$node->short_url, 'url/'. $node->short_url);
     $output .= '</td>';
-    //$output .= '<td>'.l("delete", 'knurl/remove/'.$node->short_url).'</td></tr>';
+    $output .= '<td>'.l("delete", 'knurl/remove/'.$node->short_url).'</td></tr>';
     // why do we need to delete anyway?  commented out by Sam Placette, 9-26-07
   }
   $output .= '</table>';
   $output .= theme("pager", array(2 => 3), 50);
-  return $output;  
+  return $output;
 }
 
 /**
  * Responds to /knurl/delete/${url}
- * 
+ *
  * It handles knurl removal
  */
 function knurl_remove() {
@@ -122,9 +122,9 @@ function knurl_remove() {
 
 /**
  * Responds to /url/${url}
- * 
+ *
  * Redirects the user to the given URL
- */ 
+ */
 function knurl_redirect() {
   $short_url = end($args = func_get_args());
   $res = db_fetch_object(db_query("SELECT * FROM {knurl} WHERE short_url='%s'", $short_url));
@@ -136,16 +136,16 @@ function knurl_redirect() {
 // form for adding a new knurl
 function knurl_add_form() {
   drupal_set_message( t(sprintf('Shorten long URLs by using a URL shortcut instead. Just enter the original URL (including http(s)://) and click Submit, and a new URL shortcut will be generated.')) );
-  drupal_set_message( t(sprintf('Now you can create URL shortcuts even easier than before.  Just drag this <a href="javascript:void(location.href=\''. _get_server_url() .'/knurl?url=\'+location.href)">%s knurl</A> link to your toolbar. At the click of a button, a URL shortcut will be generated for the page you are currently at.', variable_get('site_name', 'Drupal'))));
+  drupal_set_message( t(sprintf('Now you can create URL shortcuts even easier than before.  Just drag this <a href="javascript:void(location.href=\''. _get_server_url() . base_path() .'knurl?url=\'+location.href)">%s knurl</A> link to your toolbar. At the click of a button, a URL shortcut will be generated for the page you are currently at.', variable_get('site_name', 'Drupal'))));
   $form['url'] = array( '#type' => 'textarea',
     '#title' => t('Enter a fully qualified URL'),
-    '#default_value' => $_GET['url'], 
-    '#required' => TRUE 
+    '#default_value' => $_GET['url'],
+    '#required' => TRUE
   );
   $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
   if (isset($_GET['url']) && _knurl_is_valid_url($_GET['url'])) { // automagically submit if valid url is included in URI
     $form_state['values']['url'] = $_GET['url'];
-    knurl_add_form_submit( 0, $form_state['values']);
+    knurl_add_form_submit( 0, $form_state);
   }
   return $form;
 }
@@ -171,7 +171,7 @@ function knurl_add_form_submit( $form, $
   if (strlen($target_url) > $url_limit) {
     $target_url = "<br/>". wordwrap($form_state['values']['url'], $url_limit, "<br/>", true);
   }
-  if ($_SERVER['HTTPS']) {  
+  if ($_SERVER['HTTPS']) {
     $protocol = "https://";
   }
   else $protocol = "http://";
@@ -202,7 +202,7 @@ function _knurl_random_url() {
 
 /**
  * Checks if the given URL is valid
- */ 
+ */
 function _knurl_is_unique_url( $url ) {
   $result = db_result(db_query("SELECT COUNT(short_url) FROM {knurl} WHERE short_url='%s'", $url));
   return $result == 0;
@@ -210,7 +210,7 @@ function _knurl_is_unique_url( $url ) {
 
 /**
  * Check if the given URL is valid
- * 
+ *
  * based on http://tighturl.com/sourcecode/tighturl.php
  */
 function _knurl_is_valid_url( $url ) {
