From c23e83e331da80d1f5ee1b63ed8c7c59b4716748 Mon Sep 17 00:00:00 2001 From: jverber Date: Sat, 19 Jun 2004 04:41:34 +0000 Subject: [PATCH] Fix for bug #0000076: http:// added to links in link-manager when needed. Also more special chars. encoding. git-svn-id: http://svn.automattic.com/wordpress/trunk@1440 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/link-add.php | 2 +- wp-admin/link-manager.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php index ec7bd67f4b..d886f63619 100644 --- a/wp-admin/link-add.php +++ b/wp-admin/link-add.php @@ -14,7 +14,7 @@ function category_dropdown($fieldname, $selected = 0) { echo " \n"; diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index 1346745c23..6e2d341b7d 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -185,6 +185,7 @@ switch ($action) { check_admin_referer(); $link_url = $_POST['linkurl']; + $link_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $link_url) ? $link_url : 'http://' . $link_url; $link_name = $_POST['name']; $link_image = $_POST['image']; $link_target = $_POST['target']; @@ -235,6 +236,7 @@ switch ($action) { $link_id = $_POST['link_id']; $link_url = $_POST['linkurl']; + $link_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $link_url) ? $link_url : 'http://' . $link_url; $link_name = $_POST['name']; $link_image = $_POST['image']; $link_target = $_POST['target'];