aboutsummaryrefslogtreecommitdiffhomepage
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/Languages.php2
-rw-r--r--application/PageBuilder.php3
-rw-r--r--application/Updater.php12
-rw-r--r--application/Url.php2
4 files changed, 17 insertions, 2 deletions
diff --git a/application/Languages.php b/application/Languages.php
index 357c7524..3eb3388f 100644
--- a/application/Languages.php
+++ b/application/Languages.php
@@ -69,6 +69,8 @@ class Languages
69 { 69 {
70 $this->conf = $conf; 70 $this->conf = $conf;
71 $confLanguage = $this->conf->get('translation.language', 'auto'); 71 $confLanguage = $this->conf->get('translation.language', 'auto');
72 // Auto mode or invalid parameter, use the detected language.
73 // If the detected language is invalid, it doesn't matter, it will use English.
72 if ($confLanguage === 'auto' || ! $this->isValidLanguage($confLanguage)) { 74 if ($confLanguage === 'auto' || ! $this->isValidLanguage($confLanguage)) {
73 $this->language = substr($language, 0, 5); 75 $this->language = substr($language, 0, 5);
74 } else { 76 } else {
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index 468f144b..3233d6b6 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -83,7 +83,8 @@ class PageBuilder
83 ApplicationUtils::getVersionHash(SHAARLI_VERSION, $this->conf->get('credentials.salt')) 83 ApplicationUtils::getVersionHash(SHAARLI_VERSION, $this->conf->get('credentials.salt'))
84 ); 84 );
85 $this->tpl->assign('scripturl', index_url($_SERVER)); 85 $this->tpl->assign('scripturl', index_url($_SERVER));
86 $this->tpl->assign('privateonly', !empty($_SESSION['privateonly'])); // Show only private links? 86 $visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
87 $this->tpl->assign('visibility', $visibility);
87 $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly'])); 88 $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly']));
88 $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli')); 89 $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli'));
89 if ($this->conf->exists('general.header_link')) { 90 if ($this->conf->exists('general.header_link')) {
diff --git a/application/Updater.php b/application/Updater.php
index 8d2bd577..f07e7697 100644
--- a/application/Updater.php
+++ b/application/Updater.php
@@ -445,6 +445,18 @@ class Updater
445 $this->linkDB->save($this->conf->get('resource.page_cache')); 445 $this->linkDB->save($this->conf->get('resource.page_cache'));
446 return true; 446 return true;
447 } 447 }
448
449 /**
450 * Change privateonly session key to visibility.
451 */
452 public function updateMethodVisibilitySession()
453 {
454 if (isset($_SESSION['privateonly'])) {
455 unset($_SESSION['privateonly']);
456 $_SESSION['visibility'] = 'private';
457 }
458 return true;
459 }
448} 460}
449 461
450/** 462/**
diff --git a/application/Url.php b/application/Url.php
index b3759377..21c17ecc 100644
--- a/application/Url.php
+++ b/application/Url.php
@@ -260,7 +260,7 @@ class Url
260 if (! function_exists('idn_to_ascii') || ! isset($this->parts['host'])) { 260 if (! function_exists('idn_to_ascii') || ! isset($this->parts['host'])) {
261 return $out; 261 return $out;
262 } 262 }
263 $asciiHost = idn_to_ascii($this->parts['host']); 263 $asciiHost = idn_to_ascii($this->parts['host'], 0, INTL_IDNA_VARIANT_UTS46);
264 return str_replace($this->parts['host'], $asciiHost, $out); 264 return str_replace($this->parts['host'], $asciiHost, $out);
265 } 265 }
266 266