--- /usr/src/drupal/modules/ecommerce/paypal/paypal.module 
+++ /home/astbill/wwwroot/sites/default/modules/paypal/paypal.module 
@@ -120,8 +120,14 @@
   }
 
   global $base_url;
-  $return_url = variable_get('paypal_return_url', '%order-history') == '%order-history' ? t('%order-history', array('%order-history' => url("store/history/$user->uid"))) : url(variable_get('paypal_return_url', '%order-history'));
-  $return_url = $base_url .'/'. $return_url;
+
+  if (variable_get('paypal_return_url', '%order-history') == '%order-history') {
+  	$return_url = t('%order-history', array('%order-history' => url("store/history/$user->uid",NULL,NULL,TRUE)));
+  }
+  else {
+	$return_url = url(variable_get('paypal_return_url', '%order-history'),NULL,NULL,TRUE);
+  }
+
   $cancel_url = (!strstr(variable_get('paypal_cancel_url', 'node'), 'http://')) ? $base_url. '/'. variable_get("paypal_cancel_url", 'node') : variable_get("paypal_cancel_url", 'node');
 
   $item_name = ($user->uid) ? t("%site_name order #%txn_id for %user_name", array('%site_name'=>variable_get('site_name', 'drupal'),'%txn_id'=>$txn->txnid,'%user_name'=>$user->name)): t("%site_name order #%txn_id",array('%site_name'=>variable_get("site_name", "drupal"),'%txn_id'=>$txn->txnid));
