Browse Source

Merge remote-tracking branch 'origin/MinzSessionCookie' into dev

Alexandre Alapetite 10 years ago
parent
commit
27b93e9a9f

+ 10 - 1
CHANGELOG.md

@@ -1,6 +1,11 @@
 # Changelog
 
-## 2015-07-xx FreshRSS 1.1.2 (beta)
+## 2015-08-31 FreshRSS 1.1.3-beta
+
+Nothing for the moment.
+
+
+## 2015-07-30 FreshRSS 1.1.2-beta
 
 * Features
 	* Support for PubSubHubbub for instant notifications from compatible Web sites. [#312](https://github.com/FreshRSS/FreshRSS/issues/312)
@@ -23,6 +28,10 @@
 	* Fix broken links for extension script / style files. [#862](https://github.com/FreshRSS/FreshRSS/issues/862)
 	* Load default configuration during installation to avoid hard-coded values. [#890](https://github.com/FreshRSS/FreshRSS/issues/890)
 	* Fix non-consistent behaviour in Minz_Request::getBaseUrl() and introduce Minz_Request::guessBaseUrl(). [#906](https://github.com/FreshRSS/FreshRSS/issues/906)
+	* Generate `base_url` during the installation and add a `pubsubhubbub_enabled` configuration key. [#865](https://github.com/FreshRSS/FreshRSS/issues/865)
+	* Load configuration by recursion to overwrite array values. [#923](https://github.com/FreshRSS/FreshRSS/issues/923)
+	* Cast `$limits` configuration values in integer. [#925](https://github.com/FreshRSS/FreshRSS/issues/925)
+	* Don't hide errors in configuration. [#920](https://github.com/FreshRSS/FreshRSS/issues/920)
 
 
 ## 2015-05-31 FreshRSS 1.1.1 (beta)

+ 1 - 0
app/Models/ConfigurationSetter.php

@@ -362,6 +362,7 @@ class FreshRSS_ConfigurationSetter {
 				continue;
 			}
 
+			$value = intval($value);
 			$limits = $limits_keys[$key];
 			if (
 				(!isset($limits['min']) || $value >= $limits['min']) &&

+ 5 - 5
app/i18n/cz/admin.php

@@ -160,14 +160,14 @@ return array(
 		'create' => 'Vytvořit nového uživatele',
 		'email_persona' => 'Email pro přihlášení<br /><small>(pro <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>',
 		'language' => 'Jazyk',
-		'number' => 'There is %d account created yet',  // TODO: translate
-		'numbers' => 'There are %d accounts created yet',  // TODO: translate
+		'number' => 'Zatím je vytvořen %d účet',
+		'numbers' => 'Zatím je vytvořeno %d účtů',
 		'password_form' => 'Heslo<br /><small>(pro přihlášení webovým formulářem)</small>',
 		'password_format' => 'Alespoň 7 znaků',
 		'registration' => array(
-			'allow' => 'Allow account creation',  // TODO: translate
-			'help' => '0 means that there is no account limit',  // TODO: translate
-			'number' => 'Max number of accounts',  // TODO: translate
+			'allow' => 'Povolit vytváření účtů',
+			'help' => '0 znamená žádná omezení účtu',
+			'number' => 'Maximální počet účtů',
 		),
 		'title' => 'Správa uživatelů',
 		'user_list' => 'Seznam uživatelů',

+ 2 - 2
app/i18n/cz/conf.php

@@ -73,8 +73,8 @@ return array(
 	'profile' => array(
 		'_' => 'Správa profilu',
 		'delete' => array(
-			'_' => 'Account deletion',  // TODO: translate
-			'warn' => 'Your account and all the related data will be deleted.',  // TODO: translate
+			'_' => 'Smazání účtu',
+			'warn' => 'Váš účet bude smazán spolu se všemi souvisejícími daty',
 		),
 		'email_persona' => 'Email pro přihlášení<br /><small>(pro <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>',
 		'password_api' => 'Password API<br /><small>(tzn. pro mobilní aplikace)</small>',

+ 1 - 1
app/i18n/cz/feedback.php

@@ -102,7 +102,7 @@ return array(
 			'_' => 'Uživatel %s byl smazán',
 			'error' => 'Uživatele %s nelze smazat',
 		),
-		'set_registration' => 'The maximum amount of accounts has been updated.',  // TODO: translate
+		'set_registration' => 'Maximální počet účtů byl změněn',
 	),
 	'profile' => array(
 		'error' => 'Váš profil nelze změnit',

+ 3 - 3
app/i18n/cz/gen.php

@@ -32,9 +32,9 @@ return array(
 			'format' => '<small>Alespoň 7 znaků</small>',
 		),
 		'registration' => array(
-			'_' => 'New account',  // TODO: translate
-			'ask' => 'Create an account?',  // TODO: translate
-			'title' => 'Account creation',  // TODO: translate
+			'_' => 'Nový účet',
+			'ask' => 'Vytvořit účet?',
+			'title' => 'Vytvoření účtu',
 		),
 		'reset' => 'Reset přihlášení',
 		'username' => array(

+ 4 - 4
app/i18n/cz/install.php

@@ -4,9 +4,9 @@ return array(
 	'action' => array(
 		'finish' => 'Dokončit instalaci',
 		'fix_errors_before' => 'Chyby prosím před přechodem na další krok opravte.',
-		'keep_install' => 'Keep previous installation',  // TODO: translate
+		'keep_install' => 'Zachovat předchozí instalaci',
 		'next_step' => 'Přejít na další krok',
-		'reinstall' => 'Reinstall FreshRSS',  // TODO: translate
+		'reinstall' => 'Reinstalovat FreshRSS',
 	),
 	'auth' => array(
 		'email_persona' => 'Email pro přihlášení<br /><small>(pro <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>',
@@ -33,7 +33,7 @@ return array(
 	),
 	'check' => array(
 		'_' => 'Kontrola',
-		'already_installed' => 'We have detected that FreshRSS is already installed!',  // TODO: translate
+		'already_installed' => 'Zjistili jsme, že FreshRSS je již nainstalován!',
 		'cache' => array(
 			'nok' => 'Zkontrolujte oprávnění adresáře <em>./data/cache</em>. HTTP server musí mít do tohoto adresáře práva zápisu',
 			'ok' => 'Oprávnění adresáře cache jsou v pořádku.',
@@ -97,7 +97,7 @@ return array(
 	'fix_errors_before' => 'Chyby prosím před přechodem na další krok opravte.',
 	'javascript_is_better' => 'Práce s FreshRSS je příjemnější se zapnutým JavaScriptem',
 	'js' => array(
-		'confirm_reinstall' => 'You will lose your previous configuration by reinstalling FreshRSS. Are you sure you want to continue?',  // TODO: translate
+		'confirm_reinstall' => 'Reinstalací FreshRSS ztratíte předchozí konfiguraci. Opravdu chcete pokračovat?',
 	),
 	'language' => array(
 		'_' => 'Jazyk',

+ 5 - 5
app/i18n/de/admin.php

@@ -160,14 +160,14 @@ return array(
 		'create' => 'Neuen Benutzer erstellen',
 		'email_persona' => 'Anmelde-E-Mail-Adresse<br /><small>(für <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>',
 		'language' => 'Sprache',
-		'number' => 'There is %d account created yet',  // TODO: translate
-		'numbers' => 'There are %d accounts created yet',  // TODO: translate
+		'number' => 'Es wurde bis jetzt %d Account erstellt',
+		'numbers' => 'Es wurden bis jetzt %d Accounts erstellt',
 		'password_form' => 'Passwort<br /><small>(für die Anmeldemethode per Webformular)</small>',
 		'password_format' => 'mindestens 7 Zeichen',
 		'registration' => array(
-			'allow' => 'Allow account creation',  // TODO: translate
-			'help' => '0 means that there is no account limit',  // TODO: translate
-			'number' => 'Max number of accounts',  // TODO: translate
+			'allow' => 'Erlaube die Accounterstellung',
+			'help' => '0 meint, dass es kein Account Limit gibt',
+			'number' => 'Maximale Anzahl von Accounts',
 		),
 		'title' => 'Benutzer verwalten',
 		'user_list' => 'Liste der Benutzer',

+ 2 - 2
app/i18n/de/conf.php

@@ -73,8 +73,8 @@ return array(
 	'profile' => array(
 		'_' => 'Profil-Verwaltung',
 		'delete' => array(
-			'_' => 'Account deletion',  // TODO: translate
-			'warn' => 'Your account and all the related data will be deleted.',  // TODO: translate
+			'_' => 'Accountlöschung',
+			'warn' => 'Dein Account und alle damit bezogenen Daten werden gelöscht.',
 		),
 		'email_persona' => 'Anmelde-E-Mail-Adresse<br /><small>(für <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>',
 		'password_api' => 'Passwort-API<br /><small>(z. B. für mobile Anwendungen)</small>',

+ 1 - 1
app/i18n/de/feedback.php

@@ -102,7 +102,7 @@ return array(
 			'_' => 'Der Benutzer %s ist gelöscht worden',
 			'error' => 'Der Benutzer %s kann nicht gelöscht werden',
 		),
-		'set_registration' => 'The maximum amount of accounts has been updated.',  // TODO: translate
+		'set_registration' => 'Die maximale Anzahl von Accounts wurde aktualisiert.',
 	),
 	'profile' => array(
 		'error' => 'Ihr Profil kann nicht geändert werden',

+ 3 - 3
app/i18n/de/gen.php

@@ -32,9 +32,9 @@ return array(
 			'format' => '<small>mindestens 7 Zeichen</small>',
 		),
 		'registration' => array(
-			'_' => 'New account',  // TODO: translate
-			'ask' => 'Create an account?',  // TODO: translate
-			'title' => 'Account creation',  // TODO: translate
+			'_' => 'Neuer Account',
+			'ask' => 'Erstelle einen Account?',
+			'title' => 'Accounterstellung',
 		),
 		'reset' => 'Zurücksetzen der Authentifizierung',
 		'username' => array(

+ 4 - 4
app/i18n/de/install.php

@@ -4,9 +4,9 @@ return array(
 	'action' => array(
 		'finish' => 'Installation fertigstellen',
 		'fix_errors_before' => 'Bitte Fehler korrigieren, bevor zum nächsten Schritt gesprungen wird.',
-		'keep_install' => 'Keep previous installation',  // TODO: translate
+		'keep_install' => 'Vorherige Installation beibehalten (Daten)',
 		'next_step' => 'Zum nächsten Schritt springen',
-		'reinstall' => 'Reinstall FreshRSS',  // TODO: translate
+		'reinstall' => 'Neuinstallation von FreshRSS',
 	),
 	'auth' => array(
 		'email_persona' => 'Anmelde-E-Mail-Adresse<br /><small>(für <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>',
@@ -33,7 +33,7 @@ return array(
 	),
 	'check' => array(
 		'_' => 'Überprüfungen',
-		'already_installed' => 'We have detected that FreshRSS is already installed!',  // TODO: translate
+		'already_installed' => 'Wir haben festgestellt, dass FreshRSS bereits installiert wurde!',
 		'cache' => array(
 			'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data/cache</em>. Der HTTP-Server muss Schreibrechte besitzen.',
 			'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data/cache</em> sind in Ordnung.',
@@ -97,7 +97,7 @@ return array(
 	'fix_errors_before' => 'Bitte den Fehler korrigieren, bevor zum nächsten Schritt gesprungen wird.',
 	'javascript_is_better' => 'FreshRSS ist ansprechender mit aktiviertem JavaScript',
 	'js' => array(
-		'confirm_reinstall' => 'You will lose your previous configuration by reinstalling FreshRSS. Are you sure you want to continue?',  // TODO: translate
+		'confirm_reinstall' => 'Du wirst deine vorherige Konfiguration (Daten) verlieren FreshRSS. Bist du sicher, dass du fortfahren willst?',
 	),
 	'language' => array(
 		'_' => 'Sprache',

+ 1 - 1
constants.php

@@ -1,5 +1,5 @@
 <?php
-define('FRESHRSS_VERSION', '1.1.2-dev');
+define('FRESHRSS_VERSION', '1.1.3-dev');
 define('FRESHRSS_WEBSITE', 'http://freshrss.org');
 define('FRESHRSS_UPDATE_WEBSITE', 'https://update.freshrss.org?v=' . FRESHRSS_VERSION);
 define('FRESHRSS_WIKI', 'http://doc.freshrss.org');

+ 11 - 17
lib/Minz/Configuration.php

@@ -39,7 +39,7 @@ class Minz_Configuration {
 			throw new Minz_FileNotExistException($filename);
 		}
 
-		$data = @include($filename);
+		$data = include($filename);
 		if (is_array($data)) {
 			return $data;
 		} else {
@@ -84,11 +84,6 @@ class Minz_Configuration {
 	 */
 	private $data = array();
 
-	/**
-	 * The default values, an empty array by default.
-	 */
-	private $data_default = array();
-
 	/**
 	 * An object which help to set good values in configuration.
 	 */
@@ -119,21 +114,22 @@ class Minz_Configuration {
 	                             $configuration_setter = null) {
 		$this->namespace = $namespace;
 		$this->config_filename = $config_filename;
+		$this->default_filename = $default_filename;
+		$this->_configurationSetter($configuration_setter);
+
+		if (!is_null($this->default_filename)) {
+			$this->data = self::load($this->default_filename);
+		}
 
 		try {
-			$this->data = self::load($this->config_filename);
+			$this->data = array_replace_recursive(
+				$this->data, self::load($this->config_filename)
+			);
 		} catch (Minz_FileNotExistException $e) {
-			if (is_null($default_filename)) {
+			if (is_null($this->default_filename)) {
 				throw $e;
 			}
 		}
-
-		$this->default_filename = $default_filename;
-		if (!is_null($this->default_filename)) {
-			$this->data_default = self::load($this->default_filename);
-		}
-
-		$this->_configurationSetter($configuration_setter);
 	}
 
 	/**
@@ -160,8 +156,6 @@ class Minz_Configuration {
 			return $this->data[$key];
 		} elseif (!is_null($default)) {
 			return $default;
-		} elseif (isset($this->data_default[$key])) {
-			return $this->data_default[$key];
 		} else {
 			Minz_Log::warning($key . ' does not exist in configuration');
 			return null;

+ 3 - 4
lib/Minz/Session.php

@@ -65,10 +65,9 @@ class Minz_Session {
 	 * @param $l la durée de vie
 	 */
 	public static function keepCookie($l) {
-		// Get the script_name (e.g. /p/i/index.php) and keep only the path.
-		$cookie_dir = empty($_SERVER['SCRIPT_NAME']) ? '' : $_SERVER['SCRIPT_NAME'];
-		$cookie_dir = dirname($cookie_dir);
-		session_set_cookie_params($l, $cookie_dir, '', false, true);
+			// Get the script_name (e.g. /p/i/index.php) and keep only the path.
+			$cookie_dir = dirname(empty($_SERVER['REQUEST_URI']) ? '/' : dirname($_SERVER['REQUEST_URI']));
+			session_set_cookie_params($l, $cookie_dir, '', false, false);
 	}