--- common.inc.orig	2005-11-09 11:49:16.000000000 -0500
+++ common.inc	2005-11-09 12:35:59.000000000 -0500
@@ -1446,7 +1446,7 @@
  * When creating links in modules, consider whether l() could be a better
  * alternative than url().
  */
-function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) {
+function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE, $ssl = FALSE) {
   global $base_url;
 
   static $script;
@@ -1464,7 +1464,8 @@
     $fragment = '#'. $fragment;
   }
 
-  $base = ($absolute ? $base_url .'/' : '');
+  $local_url = ($ssl ?  str_replace('http://', 'https://', $base_url ) :  $base_url);
+  $base = (($absolute || $ssl) ? $local_url .'/' : '');
 
   if (variable_get('clean_url', '0') == '0') {
     if (isset($path)) {
@@ -1547,7 +1548,7 @@
  * @return
  *   an HTML string containing a link to the given path.
  */
-function l($text, $path, $attributes = array(), $query = NULL, $fragment = NULL, $absolute = FALSE, $html = FALSE) {
+function l($text, $path, $attributes = array(), $query = NULL, $fragment = NULL, $absolute = FALSE, $html = FALSE, $ssl = FALSE) {
   if (drupal_get_normal_path($path) == $_GET['q']) {
     if (isset($attributes['class'])) {
       $attributes['class'] .= ' active';
@@ -1556,7 +1557,7 @@
       $attributes['class'] = 'active';
     }
   }
-  return '<a href="'. check_url(url($path, $query, $fragment, $absolute)) .'"'. drupal_attributes($attributes) .'>'. ($html ? $text : check_plain($text)) .'</a>';
+  return '<a href="'. check_url(url($path, $query, $fragment, $absolute, $ssl)) .'"'. drupal_attributes($attributes) .'>'. ($html ? $text : check_plain($text)) .'</a>';
 }
 
 /**
