aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-04-13 19:26:18 -0400
committerSimon L'nu <simon.lnu@gmail.com>2012-04-13 19:26:18 -0400
commita3d95f79f27ca73d657907ab42b51ecc50872089 (patch)
tree74865c7ef150c0d92485f9ec1b1dd204175e34ca /include
parent093c3a936fc40e4d66f5bc5dffd1fce4ddbedcdc (diff)
parentbfb821e9188ef83fb2621250fd97bdb169447f3d (diff)
downloadvolse-hubzilla-a3d95f79f27ca73d657907ab42b51ecc50872089.tar.gz
volse-hubzilla-a3d95f79f27ca73d657907ab42b51ecc50872089.tar.bz2
volse-hubzilla-a3d95f79f27ca73d657907ab42b51ecc50872089.zip
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: well that was a silly mistake... setting wasn't being applied rev update diabook-themes: theme-settings: users can set font-size and line-height for posts and comments diabook: theme-settings: users can set font-size and line-height for posts and comments diabook-themes: small fixes quattro: language icon in navbar move html out of lang_selector() and new template lang_selector.tpl display settings: show theme screenshot on page load quattro: add admin theme settigs. darker items background with a bottom border. admin: change global theme settings quattro: work on "like" activitiy items less visible fixes to widths popup notification out of navbar category input in jot validate_url allow naked subdomain if is "localhost" * master:
Diffstat (limited to 'include')
-rw-r--r--include/network.php7
-rw-r--r--include/text.php25
2 files changed, 20 insertions, 12 deletions
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;
}
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 = '<div id="lang-select-icon" class="icon language" title="' . t('Select an alternate language') . '" onclick="openClose(\'language-selector\');" ></div>';
- $o .= '<div id="language-selector" style="display: none;" >';
- $o .= '<form action="#" method="post" ><select name="system_language" onchange="this.form.submit();" >';
+
$langs = glob('view/*/strings.php');
+
+ $lang_options = array();
+ $selected = "";
+
if(is_array($langs) && count($langs)) {
$langs[] = '';
if(! in_array('view/en/strings.php',$langs))
@@ -1079,17 +1081,22 @@ function lang_selector() {
asort($langs);
foreach($langs as $l) {
if($l == '') {
- $default_selected = ((! x($_SESSION,'language')) ? ' selected="selected" ' : '');
- $o .= '<option value="" ' . $default_selected . '>' . t('default') . '</option>';
+ $lang_options[""] = t('default');
continue;
}
$ll = substr($l,5);
$ll = substr($ll,0,strrpos($ll,'/'));
- $selected = (($ll === $lang && (x($_SESSION, 'language'))) ? ' selected="selected" ' : '');
- $o .= '<option value="' . $ll . '"' . $selected . '>' . $ll . '</option>';
+ $selected = (($ll === $lang && (x($_SESSION, 'language'))) ? $ll : $selected);
+ $lang_options[$ll]=$ll;
}
}
- $o .= '</select></form></div>';
+
+ $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
+}