diff -urN ../Nagios/base/nagios.c ./base/nagios.c
--- ../Nagios/base/nagios.c	Fri Oct 22 18:51:27 2004
+++ ./base/nagios.c	Sat Oct 23 02:49:51 2004
@@ -556,9 +556,6 @@
 				exit(ERROR);
 			        }
 
-			/* free extended info data - we don't need this for monitoring */
-			free_extended_data();
-
 			/* initialize embedded Perl interpreter */
 			init_embedded_perl();
 
diff -urN ../Nagios/base/utils.c ./base/utils.c
--- ../Nagios/base/utils.c	Fri Oct 22 18:51:29 2004
+++ ./base/utils.c	Sat Oct 23 11:14:51 2004
@@ -303,6 +303,69 @@
 /************************ MACRO FUNCTIONS *************************/
 /******************************************************************/
 
+/* substitute macros in url type vars for hostextinfo and serviceextinfo */
+char *process_extinfo_url(char *host_name, char *svc_description, char *url){
+	char input_buffer[MAX_INPUT_BUFFER]="";
+	char output_buffer[MAX_INPUT_BUFFER]="";
+	char *temp_buffer;
+	char *processed_url;
+	int in_macro=FALSE;
+	service *temp_service;
+	host *temp_host;
+
+	if(host_name==NULL || url==NULL)
+		return;
+
+	if(svc_description!=NULL) {
+		temp_service=find_service(host_name,svc_description);
+		if(temp_service==NULL)
+			return(url);
+			}
+
+	temp_host=find_host(host_name);
+	if(temp_host==NULL)
+		return(url);
+
+	strncpy(input_buffer,url,sizeof(input_buffer)-1);
+	input_buffer[sizeof(input_buffer)-1]='\x0';
+
+	for(temp_buffer=my_strtok(input_buffer,"$");temp_buffer!=NULL;temp_buffer=my_strtok(NULL,"$")){
+
+		if(in_macro==FALSE){
+			if(strlen(output_buffer)+strlen(temp_buffer)<sizeof(output_buffer)-1){
+				strncat(output_buffer,temp_buffer,sizeof(output_buffer)-strlen(output_buffer)-1);
+				output_buffer[sizeof(output_buffer)-1]='\x0';
+			        }
+			in_macro=TRUE;
+			}
+		else{
+
+			if(strlen(output_buffer)+strlen(temp_buffer) < sizeof(output_buffer)-1){
+
+				if(!strcmp(temp_buffer,"HOSTNAME"))
+					strncat(output_buffer,temp_host->name,sizeof(output_buffer)-strlen(output_buffer)-1);
+
+				else if(!strcmp(temp_buffer,"HOSTADDRESS") && temp_host!=NULL)
+					strncat(output_buffer,(temp_host->address==NULL)?"":temp_host->address,sizeof(output_buffer)-strlen(output_buffer)-1);
+
+				else if(temp_service!=NULL && !strcmp(temp_buffer,"SERVICEDESC"))
+					strncat(output_buffer,temp_service->description,sizeof(output_buffer)-strlen(output_buffer)-1);
+			        }
+
+			in_macro=FALSE;
+		        }
+	        }
+
+
+	temp_buffer=strdup(output_buffer);
+	if(temp_buffer==NULL)
+		return(url);
+
+	return(temp_buffer);
+        }
+
+
+
 /* replace macros in notification commands with their values */
 int process_macros(char *input_buffer, char *output_buffer, int buffer_length, int options){
 	char *temp_buffer;
diff -urN ../Nagios/cgi/extinfo.c ./cgi/extinfo.c
--- ../Nagios/cgi/extinfo.c	Fri Oct 22 18:51:32 2004
+++ ./cgi/extinfo.c	Sat Oct 23 04:26:07 2004
@@ -373,17 +373,15 @@
 				printf("<TABLE BORDER='0'>\n");
 				if(temp_hostextinfo->action_url!=NULL && strcmp(temp_hostextinfo->action_url,"")){
 					printf("<TR><TD ALIGN='right'>\n");
-					printf("<A HREF='");
-					print_extra_host_url(temp_hostextinfo->host_name,temp_hostextinfo->action_url);
-					printf("' TARGET='_blank'><img src='%s%s' border=0 alt='Perform Additional Actions On This Host' title='Perform Additional Actions On This Host'></A>\n",url_images_path,ACTION_ICON);
+					printf("<A HREF='%s'",url_encode(temp_hostextinfo->action_url));
+					printf(" TARGET='_blank'><img src='%s%s' border=0 alt='Perform Additional Actions On This Host' title='Perform Additional Actions On This Host'></A>\n",url_images_path,ACTION_ICON);
 					printf("<BR CLEAR=ALL><FONT SIZE=-1><I>Extra Host Actions</I></FONT><BR CLEAR=ALL><BR CLEAR=ALL>\n");
 					printf("</TD></TR>\n");
 				        }
 				if(temp_hostextinfo->notes_url!=NULL && strcmp(temp_hostextinfo->notes_url,"")){
 					printf("<TR><TD ALIGN='right'>\n");
-					printf("<A HREF='");
-					print_extra_host_url(temp_hostextinfo->host_name,temp_hostextinfo->notes_url);
-					printf("' TARGET='_blank'><img src='%s%s' border=0 alt='View Additional Notes For This Host' title='View Additional Notes For This Host'></A>\n",url_images_path,NOTES_ICON);
+					printf("<A HREF='%s'", url_encode(temp_hostextinfo->notes_url));
+					printf(" TARGET='_blank'><img src='%s%s' border=0 alt='View Additional Notes For This Host' title='View Additional Notes For This Host'></A>\n",url_images_path,NOTES_ICON);
 					printf("<BR CLEAR=ALL><FONT SIZE=-1><I>Extra Host Notes</I></FONT><BR CLEAR=ALL><BR CLEAR=ALL>\n");
 					printf("</TD></TR>\n");
 				        }
@@ -463,7 +461,7 @@
 
 	/* free all allocated memory */
 	free_memory();
-	free_extended_data();
+	free_object_data();
 	free_comment_data();
 	free_downtime_data();
 
diff -urN ../Nagios/cgi/status.c ./cgi/status.c
--- ../Nagios/cgi/status.c	Fri Oct 22 18:51:34 2004
+++ ./cgi/status.c	Sat Oct 23 04:26:44 2004
@@ -466,7 +466,7 @@
 
 	/* free all allocated memory */
 	free_memory();
-	free_extended_data();
+	free_object_data();
 	free_comment_data();
 
 	/* free memory allocated to the sort lists */
diff -urN ../Nagios/cgi/statusmap.c ./cgi/statusmap.c
--- ../Nagios/cgi/statusmap.c	Fri Oct 22 18:51:35 2004
+++ ./cgi/statusmap.c	Sat Oct 23 04:27:23 2004
@@ -293,7 +293,7 @@
 
 	/* free all allocated memory */
 	free_memory();
-	free_extended_data();
+	free_object_data();
 	free_layer_list();
 
 	return OK;
diff -urN ../Nagios/cgi/statuswrl.c ./cgi/statuswrl.c
--- ../Nagios/cgi/statuswrl.c	Fri Oct 22 18:51:35 2004
+++ ./cgi/statuswrl.c	Sat Oct 23 04:27:04 2004
@@ -181,7 +181,7 @@
 
 	/* free all allocated memory */
 	free_memory();
-	free_extended_data();
+	free_object_data();
 
 	return OK;
         }
diff -urN ../Nagios/common/objects.c ./common/objects.c
--- ../Nagios/common/objects.c	Fri Oct 22 18:51:41 2004
+++ ./common/objects.c	Sat Oct 23 11:38:20 2004
@@ -4351,7 +4351,11 @@
 	if(notes_url==NULL || !strcmp(notes_url,""))
 		new_hostextinfo->notes_url=NULL;
 	else{
+#ifdef NSCORE
+		new_hostextinfo->notes_url=process_extinfo_url(new_hostextinfo->host_name,NULL,notes_url);
+#else
 		new_hostextinfo->notes_url=strdup(notes_url);
+#endif
 		if(new_hostextinfo->notes_url==NULL){
 			free(new_hostextinfo->notes);
 			free(new_hostextinfo->host_name);
@@ -4368,7 +4372,11 @@
 	if(action_url==NULL || !strcmp(action_url,""))
 		new_hostextinfo->action_url=NULL;
 	else{
+#ifdef NSCORE
+		new_hostextinfo->action_url=process_extinfo_url(new_hostextinfo->host_name,NULL,action_url);
+#else
 		new_hostextinfo->action_url=strdup(action_url);
+#endif
 		if(new_hostextinfo->action_url==NULL){
 			free(new_hostextinfo->notes_url);
 			free(new_hostextinfo->notes);
@@ -4601,7 +4609,11 @@
 	if(notes_url==NULL || !strcmp(notes_url,""))
 		new_serviceextinfo->notes_url=NULL;
 	else{
+#ifdef NSCORE
+		new_serviceextinfo->notes_url=process_extinfo_url(new_serviceextinfo->host_name,new_serviceextinfo->description,notes_url);
+#else
 		new_serviceextinfo->notes_url=strdup(notes_url);
+#endif
 		if(new_serviceextinfo->notes_url==NULL){
 			free(new_serviceextinfo->notes);
 			free(new_serviceextinfo->description);
@@ -4619,7 +4631,11 @@
 	if(action_url==NULL || !strcmp(action_url,""))
 		new_serviceextinfo->action_url=NULL;
 	else{
+#ifdef NSCORE
+		new_serviceextinfo->action_url=process_extinfo_url(new_serviceextinfo->host_name,new_serviceextinfo->description,action_url);
+#else
 		new_serviceextinfo->action_url=strdup(action_url);
+#endif
 		if(new_serviceextinfo->action_url==NULL){
 			free(new_serviceextinfo->notes_url);
 			free(new_serviceextinfo->notes);
@@ -5687,6 +5703,11 @@
 	hostdependency *next_hostdependency=NULL;
 	hostescalation *this_hostescalation=NULL;
 	hostescalation *next_hostescalation=NULL;
+	hostextinfo *this_hostextinfo;
+	hostextinfo *next_hostextinfo;
+	serviceextinfo *this_serviceextinfo;
+	serviceextinfo *next_serviceextinfo;
+
 	int day;
 	int i;
 
@@ -6035,32 +6056,10 @@
 	hostescalation_hashlist=NULL;
 	hostescalation_list=NULL;
 
-	/* free extended info data */
-	free_extended_data();
-
 #ifdef DEBUG1
 	printf("\thostescalation_list freed\n");
 #endif
 
-#ifdef DEBUG0
-	printf("free_object_data() end\n");
-#endif
-
-	return OK;
-        }
-
-
-/* free all allocated memory for extended info objects */
-int free_extended_data(void){
-	hostextinfo *this_hostextinfo;
-	hostextinfo *next_hostextinfo;
-	serviceextinfo *this_serviceextinfo;
-	serviceextinfo *next_serviceextinfo;
-
-#ifdef DEBUG0
-	printf("free_extended_data() start\n");
-#endif
-
 	/* free memory for the extended host info list */
 	for(this_hostextinfo=hostextinfo_list;this_hostextinfo!=NULL;this_hostextinfo=next_hostextinfo){
 		next_hostextinfo=this_hostextinfo->next;
@@ -6105,11 +6104,9 @@
 	serviceextinfo_hashlist=NULL;
 	serviceextinfo_list=NULL;
 
-
 #ifdef DEBUG0
-	printf("free_extended_data() start\n");
+	printf("free_object_data() end\n");
 #endif
 
 	return OK;
         }
-
diff -urN ../Nagios/include/nagios.h.in ./include/nagios.h.in
--- ../Nagios/include/nagios.h.in	Fri Oct 22 18:52:17 2004
+++ ./include/nagios.h.in	Sat Oct 23 03:59:46 2004
@@ -594,6 +594,7 @@
 
 
 /**** Macro Functions ****/
+char *process_extinfo_url(char *,char *,char *);        /* replace macros with their actual values in extinfo object urls */
 int process_macros(char *,char *,int,int);             	/* replace macros with their actual values */
 char *clean_macro_chars(char *,int);                    /* cleans macros characters before insertion into output string */
 int grab_service_macros(service *);                  	/* updates the service macro data */
