nextId)) { ?>
- nextId; ?>
+ nextId;
+ $params['ajax'] = 1;
+ ?>
--
cgit v1.2.3
From fc5cae981f906bc887eaf053b1826f9153210423 Mon Sep 17 00:00:00 2001
From: Marien Fressinaud
Date: Wed, 17 Sep 2014 09:25:01 +0200
Subject: Show a message to warn about loading divided by 2
See https://github.com/marienfressinaud/FreshRSS/issues/559
---
app/i18n/en.php | 1 +
app/i18n/fr.php | 1 +
app/views/configure/reading.phtml | 3 +++
3 files changed, 5 insertions(+)
diff --git a/app/i18n/en.php b/app/i18n/en.php
index 8f39115ad..0c6d0e94f 100644
--- a/app/i18n/en.php
+++ b/app/i18n/en.php
@@ -269,6 +269,7 @@ return array (
'reading_configuration' => 'Reading',
'display_configuration' => 'Display',
'articles_per_page' => 'Number of articles per page',
+ 'number_divided_when_unfolded' => 'Divided by 2 during loading of unfolded articles.',
'default_view' => 'Default view',
'sort_order' => 'Sort order',
'auto_load_more' => 'Load next articles at the page bottom',
diff --git a/app/i18n/fr.php b/app/i18n/fr.php
index 48b4c1732..403638c99 100644
--- a/app/i18n/fr.php
+++ b/app/i18n/fr.php
@@ -269,6 +269,7 @@ return array (
'reading_configuration' => 'Lecture',
'display_configuration' => 'Affichage',
'articles_per_page' => 'Nombre d’articles par page',
+ 'number_divided_when_unfolded' => 'Divisé par 2 lors du chargement d’articles dépliés.',
'default_view' => 'Vue par défaut',
'sort_order' => 'Ordre de tri',
'auto_load_more' => 'Charger les articles suivants en bas de page',
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml
index 5a26501a4..87dff91a6 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -10,6 +10,9 @@
+ conf->display_posts) { ?>
+
+
--
cgit v1.2.3
From 9fec7f328b077993499c282ccb59414fb50ca84f Mon Sep 17 00:00:00 2001
From: Marien Fressinaud
Date: Wed, 17 Sep 2014 11:22:45 +0200
Subject: Coding style + i18n
Change "Show only unread or read if no unread" into "Adjust showing". It
is less explicit but shorter.
---
app/Models/Configuration.php | 24 ++++++++++++------------
app/i18n/en.php | 2 +-
app/i18n/fr.php | 2 +-
app/views/configure/reading.phtml | 8 ++++----
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php
index e47b042c8..352e70f4f 100644
--- a/app/Models/Configuration.php
+++ b/app/Models/Configuration.php
@@ -141,18 +141,18 @@ class FreshRSS_Configuration {
}
}
public function _default_view ($value) {
- switch ($value):
- case FreshRSS_Entry::STATE_ALL:
- // left blank on purpose
- case FreshRSS_Entry::STATE_NOT_READ:
- // left blank on purpose
- case FreshRSS_Entry::STATE_NOT_READ_STRICT:
- $this->data['default_view'] = $value;
- break;
- default:
- $this->data['default_view'] = FreshRSS_Entry::STATE_ALL;
- break;
- endswitch;
+ switch ($value) {
+ case FreshRSS_Entry::STATE_ALL:
+ // left blank on purpose
+ case FreshRSS_Entry::STATE_NOT_READ:
+ // left blank on purpose
+ case FreshRSS_Entry::STATE_NOT_READ_STRICT:
+ $this->data['default_view'] = $value;
+ break;
+ default:
+ $this->data['default_view'] = FreshRSS_Entry::STATE_ALL;
+ break;
+ }
}
public function _display_posts ($value) {
$this->data['display_posts'] = ((bool)$value) && $value !== 'no';
diff --git a/app/i18n/en.php b/app/i18n/en.php
index 7c66864c1..562697585 100644
--- a/app/i18n/en.php
+++ b/app/i18n/en.php
@@ -92,7 +92,7 @@ return array (
'rss_view' => 'RSS feed',
'show_all_articles' => 'Show all articles',
'show_not_reads' => 'Show only unread',
- 'show_not_reads_with_fallback' => 'Show only unread or read if no unread',
+ 'show_adaptive' => 'Adjust showing',
'show_read' => 'Show only read',
'show_favorite' => 'Show only favorites',
'show_not_favorite' => 'Show all but favorites',
diff --git a/app/i18n/fr.php b/app/i18n/fr.php
index 327661035..9516f66cb 100644
--- a/app/i18n/fr.php
+++ b/app/i18n/fr.php
@@ -92,7 +92,7 @@ return array (
'rss_view' => 'Flux RSS',
'show_all_articles' => 'Afficher tous les articles',
'show_not_reads' => 'Afficher les non lus',
- 'show_not_reads_with_fallback' => 'Afficher les non lus ou les lus si aucun non lus',
+ 'show_adaptive' => 'Adapter l’affichage',
'show_read' => 'Afficher les lus',
'show_favorite' => 'Afficher les favoris',
'show_not_favorite' => 'Afficher tout sauf les favoris',
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml
index 9bd145a3b..3dd457a2b 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -38,12 +38,12 @@
-
+
--
cgit v1.2.3
From a3b5e72729be08f79585c782d497f49edd11c064 Mon Sep 17 00:00:00 2001
From: Marien Fressinaud
Date: Wed, 17 Sep 2014 13:26:32 +0200
Subject: Move button to apply update outside the message
---
app/Controllers/updateController.php | 4 +++-
app/i18n/en.php | 3 ++-
app/i18n/fr.php | 3 ++-
app/views/update/index.phtml | 4 ++++
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 72244e9c7..78d636163 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -11,6 +11,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
}
Minz_View::prependTitle(_t('update_system') . ' · ');
+ $this->view->update_to_apply = false;
$this->view->last_update_time = 'unknown';
$this->view->check_last_hour = false;
$timestamp = (int)@file_get_contents(DATA_PATH . '/last_update.txt');
@@ -29,10 +30,11 @@ class FreshRSS_update_Controller extends Minz_ActionController {
);
} elseif (file_exists(UPDATE_FILENAME)) {
// There is an update file to apply!
+ $this->view->update_to_apply = true;
$this->view->message = array(
'status' => 'good',
'title' => _t('ok'),
- 'body' => _t('update_can_apply', _url('update', 'apply'))
+ 'body' => _t('update_can_apply')
);
}
}
diff --git a/app/i18n/en.php b/app/i18n/en.php
index 562697585..f84593cb5 100644
--- a/app/i18n/en.php
+++ b/app/i18n/en.php
@@ -428,7 +428,8 @@ return array (
'update_system' => 'Update system',
'update_check' => 'Check for new updates',
'update_last' => 'Last verification: %s',
- 'update_can_apply' => 'There is an available update. Apply',
+ 'update_can_apply' => 'There is an available update.',
+ 'update_apply' => 'Apply',
'update_server_not_found' => 'Update server cannot be found. [%s]',
'no_update' => 'No update to apply',
'update_problem' => 'Update has encountered an error: %s',
diff --git a/app/i18n/fr.php b/app/i18n/fr.php
index 9516f66cb..da5819529 100644
--- a/app/i18n/fr.php
+++ b/app/i18n/fr.php
@@ -428,7 +428,8 @@ return array (
'update_system' => 'Système de mise à jour',
'update_check' => 'Vérifier les mises à jour',
'update_last' => 'Dernière vérification : %s',
- 'update_can_apply' => 'Il y’a une mise à jour à appliquer. Appliquer la mise à jour',
+ 'update_can_apply' => 'Il y’a une mise à jour à appliquer.',
+ 'update_apply' => 'Appliquer la mise à jour',
'update_server_not_found' => 'Le serveur de mise à jour n’a pas été trouvé. [%s]',
'no_update' => 'Aucune mise à jour à appliquer',
'update_problem' => 'La mise à jour a rencontré un problème : %s',
diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml
index 5be8b1e8b..401f6acd6 100644
--- a/app/views/update/index.phtml
+++ b/app/views/update/index.phtml
@@ -29,4 +29,8 @@
+
+ update_to_apply) { ?>
+
+
--
cgit v1.2.3
From 3b8c381689334a15e7c034425f8615860dc3fa13 Mon Sep 17 00:00:00 2001
From: Marien Fressinaud
Date: Wed, 17 Sep 2014 13:37:39 +0200
Subject: No cache for update system
See https://github.com/marienfressinaud/FreshRSS/issues/616
---
app/Controllers/updateController.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 78d636163..da5bddc65 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -10,6 +10,8 @@ class FreshRSS_update_Controller extends Minz_ActionController {
);
}
+ invalidateHttpCache();
+
Minz_View::prependTitle(_t('update_system') . ' · ');
$this->view->update_to_apply = false;
$this->view->last_update_time = 'unknown';
--
cgit v1.2.3
From 75bf305b2f084958d43689b3781d03a29cc21f60 Mon Sep 17 00:00:00 2001
From: Marien Fressinaud
Date: Wed, 17 Sep 2014 14:07:52 +0200
Subject: Test HTTP REFERER in install.php
Test is actually basic, we need to use
Minz_Request::isRefererFromSameDomain() method to improve checking
---
app/i18n/install.en.php | 2 ++
app/i18n/install.fr.php | 2 ++
app/install.php | 11 ++++++++++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/app/i18n/install.en.php b/app/i18n/install.en.php
index 50208fcef..487b5073a 100644
--- a/app/i18n/install.en.php
+++ b/app/i18n/install.en.php
@@ -42,6 +42,8 @@ return array (
'data_is_ok' => 'Permissions on data directory are good',
'persona_is_ok' => 'Permissions on Mozilla Persona directory are good',
'file_is_nok' => 'Check permissions on %s directory. HTTP server must have rights to write into',
+ 'http_referer_is_ok' => 'Your HTTP REFERER is known and corresponds to your server.',
+ 'http_referer_is_nok' => 'Please check you are not altering your HTTP REFERER.',
'fix_errors_before' => 'Fix errors before skip to the next step.',
'general_conf_is_ok' => 'General configuration has been saved.',
diff --git a/app/i18n/install.fr.php b/app/i18n/install.fr.php
index 9c039f904..785c02459 100644
--- a/app/i18n/install.fr.php
+++ b/app/i18n/install.fr.php
@@ -42,6 +42,8 @@ return array (
'data_is_ok' => 'Les droits sur le répertoire de data sont bons',
'persona_is_ok' => 'Les droits sur le répertoire de Mozilla Persona sont bons',
'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire %s. Le serveur HTTP doit être capable d’écrire dedans',
+ 'http_referer_is_ok' => 'Le HTTP REFERER est connu et semble correspondre à votre serveur.',
+ 'http_referer_is_nok' => 'Veuillez vérifier que vous ne modifiez pas votre HTTP REFERER.',
'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.',
'general_conf_is_ok' => 'La configuration générale a été enregistrée.',
diff --git a/app/install.php b/app/install.php
index 8986e9965..f31764545 100644
--- a/app/install.php
+++ b/app/install.php
@@ -307,6 +307,7 @@ function checkStep1() {
$log = LOG_PATH && is_writable(LOG_PATH);
$favicons = is_writable(DATA_PATH . '/favicons');
$persona = is_writable(DATA_PATH . '/persona');
+ $http_referer = !empty($_SERVER['HTTP_REFERER']);
return array(
'php' => $php ? 'ok' : 'ko',
@@ -323,8 +324,10 @@ function checkStep1() {
'log' => $log ? 'ok' : 'ko',
'favicons' => $favicons ? 'ok' : 'ko',
'persona' => $persona ? 'ok' : 'ko',
+ 'http_referer' => $http_referer ? 'ok' : 'ko',
'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom &&
- $data && $cache && $log && $favicons && $persona ? 'ok' : 'ko'
+ $data && $cache && $log && $favicons && $persona && $http_referer ?
+ 'ok' : 'ko'
);
}
@@ -548,6 +551,12 @@ function printStep1() {
+
+
+
+
+
+
--
cgit v1.2.3
From fc7d2a0bf271e43a9e6001dccef61ec0762eb840 Mon Sep 17 00:00:00 2001
From: Marien Fressinaud
Date: Wed, 17 Sep 2014 14:21:56 +0200
Subject: Move http referer test into lib_rss
Rename method (coding style)
Change in app/FreshRSS.php
Improve test of app/install.php
---
app/FreshRSS.php | 2 +-
app/install.php | 2 +-
lib/Minz/Request.php | 14 --------------
lib/lib_rss.php | 14 ++++++++++++++
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index 6cca27f78..347b8392f 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -6,7 +6,7 @@ class FreshRSS extends Minz_FrontController {
}
$loginOk = $this->accessControl(Minz_Session::param('currentUser', ''));
$this->loadParamsView();
- if (Minz_Request::isPost() && !Minz_Request::isRefererFromSameDomain()) {
+ if (Minz_Request::isPost() && !is_referer_from_same_domain()) {
$loginOk = false; //Basic protection against XSRF attacks
Minz_Error::error(
403,
diff --git a/app/install.php b/app/install.php
index f31764545..362ffec48 100644
--- a/app/install.php
+++ b/app/install.php
@@ -307,7 +307,7 @@ function checkStep1() {
$log = LOG_PATH && is_writable(LOG_PATH);
$favicons = is_writable(DATA_PATH . '/favicons');
$persona = is_writable(DATA_PATH . '/persona');
- $http_referer = !empty($_SERVER['HTTP_REFERER']);
+ $http_referer = is_referer_from_same_domain();
return array(
'php' => $php ? 'ok' : 'ko',
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php
index ec4e25a6b..52f53012f 100644
--- a/lib/Minz/Request.php
+++ b/lib/Minz/Request.php
@@ -84,20 +84,6 @@ class Minz_Request {
return $_SERVER['HTTP_HOST'];
}
- public static function isRefererFromSameDomain() {
- if (empty($_SERVER['HTTP_REFERER'])) {
- return false;
- }
- $host = parse_url(((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://') .
- (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST']));
- $referer = parse_url($_SERVER['HTTP_REFERER']);
- if (empty($host['scheme']) || empty($referer['scheme']) || $host['scheme'] !== $referer['scheme'] ||
- empty($host['host']) || empty($referer['host']) || $host['host'] !== $referer['host']) {
- return false;
- }
- return (isset($host['port']) ? $host['port'] : 0) === (isset($referer['port']) ? $referer['port'] : 0);
- }
-
/**
* Détermine la base de l'url
* @return la base de l'url
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 823f53716..31c9cdbc1 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -230,3 +230,17 @@ function cryptAvailable() {
}
return false;
}
+
+function is_referer_from_same_domain() {
+ if (empty($_SERVER['HTTP_REFERER'])) {
+ return false;
+ }
+ $host = parse_url(((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://') .
+ (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST']));
+ $referer = parse_url($_SERVER['HTTP_REFERER']);
+ if (empty($host['scheme']) || empty($referer['scheme']) || $host['scheme'] !== $referer['scheme'] ||
+ empty($host['host']) || empty($referer['host']) || $host['host'] !== $referer['host']) {
+ return false;
+ }
+ return (isset($host['port']) ? $host['port'] : 0) === (isset($referer['port']) ? $referer['port'] : 0);
+}
--
cgit v1.2.3
From fc86d14ade745ca65f8ec8e6eaa0fb4c817961a2 Mon Sep 17 00:00:00 2001
From: Alexandre Alapetite
Date: Wed, 17 Sep 2014 21:17:55 +0200
Subject: Bug purge
https://github.com/marienfressinaud/FreshRSS/issues/493
---
app/Models/FeedDAO.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index 756b1f008..b89ae2045 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -331,7 +331,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
$id_max = intval($date_min) . '000000';
$stm->bindParam(':id_feed', $id, PDO::PARAM_INT);
- $stm->bindParam(':id_max', $id_max, PDO::PARAM_INT);
+ $stm->bindParam(':id_max', $id_max, PDO::PARAM_STR);
$stm->bindParam(':keep', $keep, PDO::PARAM_INT);
if ($stm && $stm->execute()) {
--
cgit v1.2.3
From de5c0bc00962175198aeefabefa514415a448d61 Mon Sep 17 00:00:00 2001
From: Alexandre Alapetite
Date: Wed, 17 Sep 2014 21:19:48 +0200
Subject: Misc minor details + a few i18n corrections
https://github.com/marienfressinaud/FreshRSS/issues/618
---
app/FreshRSS.php | 7 ++++---
app/i18n/en.php | 6 +++---
app/i18n/fr.php | 2 +-
app/i18n/install.en.php | 2 +-
app/layout/aside_configure.phtml | 16 ++++++++--------
5 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index 347b8392f..cdf8962cb 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -143,11 +143,12 @@ class FreshRSS extends Minz_FrontController {
$theme = FreshRSS_Themes::load($this->conf->theme);
if ($theme) {
foreach($theme['files'] as $file) {
- $theme_id = $theme['id'];
- $filename = $file;
- if ($file[0] == '_') {
+ if ($file[0] === '_') {
$theme_id = 'base-theme';
$filename = substr($file, 1);
+ } else {
+ $theme_id = $theme['id'];
+ $filename = $file;
}
$filetime = @filemtime(PUBLIC_PATH . '/themes/' . $theme_id . '/' . $filename);
Minz_View::appendStyle(Minz_Url::display(
diff --git a/app/i18n/en.php b/app/i18n/en.php
index f84593cb5..b14b36b32 100644
--- a/app/i18n/en.php
+++ b/app/i18n/en.php
@@ -428,10 +428,10 @@ return array (
'update_system' => 'Update system',
'update_check' => 'Check for new updates',
'update_last' => 'Last verification: %s',
- 'update_can_apply' => 'There is an available update.',
+ 'update_can_apply' => 'An update is available.',
'update_apply' => 'Apply',
'update_server_not_found' => 'Update server cannot be found. [%s]',
'no_update' => 'No update to apply',
- 'update_problem' => 'Update has encountered an error: %s',
- 'update_finished' => 'Update is now finished!',
+ 'update_problem' => 'The update process has encountered an error: %s',
+ 'update_finished' => 'Update completed!',
);
diff --git a/app/i18n/fr.php b/app/i18n/fr.php
index da5819529..3dc429bbb 100644
--- a/app/i18n/fr.php
+++ b/app/i18n/fr.php
@@ -428,7 +428,7 @@ return array (
'update_system' => 'Système de mise à jour',
'update_check' => 'Vérifier les mises à jour',
'update_last' => 'Dernière vérification : %s',
- 'update_can_apply' => 'Il y’a une mise à jour à appliquer.',
+ 'update_can_apply' => 'Une mise à jour est disponible.',
'update_apply' => 'Appliquer la mise à jour',
'update_server_not_found' => 'Le serveur de mise à jour n’a pas été trouvé. [%s]',
'no_update' => 'Aucune mise à jour à appliquer',
diff --git a/app/i18n/install.en.php b/app/i18n/install.en.php
index 487b5073a..c422de90f 100644
--- a/app/i18n/install.en.php
+++ b/app/i18n/install.en.php
@@ -43,7 +43,7 @@ return array (
'persona_is_ok' => 'Permissions on Mozilla Persona directory are good',
'file_is_nok' => 'Check permissions on %s directory. HTTP server must have rights to write into',
'http_referer_is_ok' => 'Your HTTP REFERER is known and corresponds to your server.',
- 'http_referer_is_nok' => 'Please check you are not altering your HTTP REFERER.',
+ 'http_referer_is_nok' => 'Please check that you are not altering your HTTP REFERER.',
'fix_errors_before' => 'Fix errors before skip to the next step.',
'general_conf_is_ok' => 'General configuration has been saved.',
diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml
index 03bea4836..d5c9bf4c9 100644
--- a/app/layout/aside_configure.phtml
+++ b/app/layout/aside_configure.phtml
@@ -1,32 +1,32 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
--
cgit v1.2.3
From 0ef1fd6e4dd55f3626bae585b04b82ad194b8c63 Mon Sep 17 00:00:00 2001
From: Alexandre Alapetite
Date: Wed, 17 Sep 2014 22:22:14 +0200
Subject: Style: reduce white space of line breaks in articles
Makes articles a bit more compact.
Plus a generic filter for multiple lines breaks, useful for instance in
LeMonde.fr, which uses