From 67a2d5be771514b17b3f96979e7c2c350aa24778 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Fri, 13 Apr 2012 09:42:53 +0200 Subject: validate_url allow naked subdomain if is "localhost" --- include/network.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/network.php b/include/network.php index 23ef50b21..8c678a443 100644 --- a/include/network.php +++ b/include/network.php @@ -587,13 +587,14 @@ function fetch_xrd_links($url) { if(! function_exists('validate_url')) { function validate_url(&$url) { - // no naked subdomains - if(strpos($url,'.') === false) + + // no naked subdomains (allow localhost for tests) + if(strpos($url,'.') === false && strpos($url,'/localhost/') === false) return false; if(substr($url,0,4) != 'http') $url = 'http://' . $url; $h = @parse_url($url); - + if(($h) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR))) { return true; } -- cgit v1.2.3 From 4496d075e50c7dd8bd3506bac5d97ed2a913ab86 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Fri, 13 Apr 2012 11:56:21 +0200 Subject: move html out of lang_selector() and new template lang_selector.tpl --- include/text.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 4ec59a665..8c8db66a9 100644 --- a/include/text.php +++ b/include/text.php @@ -1068,10 +1068,12 @@ function unamp($s) { if(! function_exists('lang_selector')) { function lang_selector() { global $lang; - $o = '
'; - $o .= ''; + + $tpl = get_markup_template("lang_selector.tpl"); + $o = replace_macros($tpl, array( + '$title' => t('Select an alternate language'), + '$langs' => array($lang_options, $selected), + + )); return $o; }} @@ -1510,4 +1517,4 @@ function fix_mce_lf($s) { $s = str_replace("\r\n","\n",$s); $s = str_replace("\n\n","\n",$s); return $s; -} \ No newline at end of file +} -- cgit v1.2.3