Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 700)
+++ trunk/CHANGELOG	(revision 701)
@@ -11,6 +11,8 @@
 ! = Update/Change
 
 ------------------------------------- 2.7.0 -------------------------------------
+16-Feb-2008	Thomas Hornik
+!	updated upgrade-script (menulink)
 13-Feb-2008 Thomas Hornik
 +	allow externl links in menulink-module
 #	fixed an highlighting-issue: highlighting a page with more than one sections mangled umlauts in the second to last section.
Index: trunk/wb/upgrade-script.php
===================================================================
--- trunk/wb/upgrade-script.php	(revision 700)
+++ trunk/wb/upgrade-script.php	(revision 701)
@@ -231,6 +231,7 @@
 		`page_id` INT(11) NOT NULL DEFAULT '0',
 		`target_page_id` INT(11) NOT NULL DEFAULT '0',
 		`anchor` VARCHAR(255) NOT NULL DEFAULT '0' ,
+		`extern` VARCHAR(255) NOT NULL DEFAULT '' ,
 		PRIMARY KEY (`section_id`)
 	)
 ");
@@ -321,7 +322,12 @@
 	if($query_pid = $database->query("SELECT page_id FROM $table_p WHERE page_id != '$page_id' AND link = '$link'")) {
 		$res = $query_pid->fetchRow();
 		$target_page_id = $res['page_id'];
-		$database->query("INSERT INTO $table_mm (page_id, section_id, target_page_id, anchor) VALUES ('$page_id', '$section_id', '$target_page_id', '0')");
+		$extern = '';
+		if(strpos($link, '://') !== FALSE || strpos($link, 'mailto:') !== FALSE) {
+			$target_page_id=-1;
+			$extern=addslashes($link);
+		}
+		$database->query("INSERT INTO $table_mm (page_id, section_id, target_page_id, anchor, extern) VALUES ('$page_id', '$section_id', '$target_page_id', '0', '$extern')");
 		echo (mysql_error()?'mySQL: '.mysql_error().'<br />':'');
 	}
 }
