From 9c012e6c81e435736bfef78e0669cd236ed9d73b Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 2 Mar 2017 22:57:02 +0100 Subject: Fix SQLite CLI install https://github.com/FreshRSS/FreshRSS/issues/1445 https://github.com/FreshRSS/FreshRSS/issues/1443 https://github.com/FreshRSS/FreshRSS/issues/1443 --- lib/lib_rss.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index aaeeb431f..2d593b6a2 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -295,17 +295,12 @@ function invalidateHttpCache($username = '') { function listUsers() { $final_list = array(); $base_path = join_path(DATA_PATH, 'users'); - $dir_list = array_values(array_diff( - scandir($base_path), - array('..', '.', '_') - )); - + $dir_list = scandir($base_path); foreach ($dir_list as $file) { - if (is_dir(join_path($base_path, $file))) { + if ($file[0] !== '.' && is_dir(join_path($base_path, $file)) && file_exists(join_path($base_path, $file, 'config.php'))) { $final_list[] = $file; } } - return $final_list; } -- cgit v1.2.3 From 59dfc64512372eaba7609d84500d943bb7274399 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 2 Mar 2017 23:10:36 +0100 Subject: Fix favicon warning https://github.com/FreshRSS/FreshRSS/issues/1445 --- lib/Favicon/DataAccess.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Favicon/DataAccess.php b/lib/Favicon/DataAccess.php index ae7509881..838df66c3 100644 --- a/lib/Favicon/DataAccess.php +++ b/lib/Favicon/DataAccess.php @@ -16,7 +16,7 @@ class DataAccess { public function retrieveHeader($url) { $this->set_context(); $headers = @get_headers($url, 1); - return $headers ? array_change_key_case($headers) : array(); + return is_array($headers) ? array_change_key_case($headers) : array(); } public function saveCache($file, $data) { -- cgit v1.2.3 From a7541315c3eb46c156fe79aca9110f7275a4215d Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 2 Mar 2017 23:11:13 +0100 Subject: Favicon DataAccess whitespace --- lib/Favicon/DataAccess.php | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'lib') diff --git a/lib/Favicon/DataAccess.php b/lib/Favicon/DataAccess.php index 838df66c3..4c1a29541 100644 --- a/lib/Favicon/DataAccess.php +++ b/lib/Favicon/DataAccess.php @@ -9,33 +9,33 @@ namespace Favicon; **/ class DataAccess { public function retrieveUrl($url) { - $this->set_context(); - return @file_get_contents($url); + $this->set_context(); + return @file_get_contents($url); } - + public function retrieveHeader($url) { - $this->set_context(); + $this->set_context(); $headers = @get_headers($url, 1); return is_array($headers) ? array_change_key_case($headers) : array(); } - - public function saveCache($file, $data) { - file_put_contents($file, $data); - } - - public function readCache($file) { - return file_get_contents($file); - } - - private function set_context() { - stream_context_set_default( - array( - 'http' => array( - 'method' => 'GET', - 'timeout' => 10, - 'header' => "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0; Favicon; +https://github.com/ArthurHoaro/favicon) Gecko/20100101 Firefox/32.0\r\n", - ) - ) - ); - } -} \ No newline at end of file + + public function saveCache($file, $data) { + file_put_contents($file, $data); + } + + public function readCache($file) { + return file_get_contents($file); + } + + private function set_context() { + stream_context_set_default( + array( + 'http' => array( + 'method' => 'GET', + 'timeout' => 10, + 'header' => "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0; Favicon; +https://github.com/ArthurHoaro/favicon) Gecko/20100101 Firefox/32.0\r\n", + ) + ) + ); + } +} -- cgit v1.2.3 From 2818c72f5ae00276a083d0c24454394e9d064c7c Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 4 Mar 2017 11:53:57 +0100 Subject: Changelog CLI https://github.com/FreshRSS/FreshRSS/issues/1443 https://github.com/FreshRSS/FreshRSS/pull/1444 https://github.com/FreshRSS/FreshRSS/issues/1445 https://github.com/FreshRSS/FreshRSS/pull/1447 https://github.com/FreshRSS/FreshRSS/issues/1448 https://github.com/FreshRSS/FreshRSS/issues/1449 --- CHANGELOG.md | 6 ++++++ lib/lib_rss.php | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/CHANGELOG.md b/CHANGELOG.md index 44c6d333f..27f04791e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,13 +8,19 @@ * Share with GNU social [#1422](https://github.com/FreshRSS/FreshRSS/issues/1422) * CLI * New command `./cli/reconfigure.php` to update an existing installation [#1439](https://github.com/FreshRSS/FreshRSS/pull/1439) + * Many CLI improvements [#1447](https://github.com/FreshRSS/FreshRSS/pull/1447) + * More information (number of feeds, articles, etc.) in `./cli/user-info.php` + * Better idempotency of `./cli/do-install.php` and language parameter [#1449](https://github.com/FreshRSS/FreshRSS/issues/1449) * UI * New theme *Origine-compact* [#1388](https://github.com/FreshRSS/FreshRSS/pull/1388) * Chrome parity with Firefox: auto-focus tab when clicking on notification [#1409](https://github.com/FreshRSS/FreshRSS/pull/1409) * Bug fixing * Fix PostgreSQL bugs with API and feed modifications [#1417](https://github.com/FreshRSS/FreshRSS/pull/1417) + * Fix several CLI issues [#1445](https://github.com/FreshRSS/FreshRSS/issues/1445) + * Fix CLI install bugs with SQLite [#1443](https://github.com/FreshRSS/FreshRSS/issues/1443), [#1448](https://github.com/FreshRSS/FreshRSS/issues/1448) * Allow empty strings in CLI do-install [#1435](https://github.com/FreshRSS/FreshRSS/pull/1435) * Do not mark as read in anonymous mode [#1431](https://github.com/FreshRSS/FreshRSS/issues/1431) + * Fix Favicons warning [#59dfc64](https://github.com/FreshRSS/FreshRSS/pull/1447/commits/59dfc64512372eaba7609d84500d943bb7274399) * Security * Sanitize feed Web site URL [#1434](https://github.com/FreshRSS/FreshRSS/issues/1434) * No version number for anonymous users [#1404](https://github.com/FreshRSS/FreshRSS/issues/1404) diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 2d593b6a2..4298e90bf 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -295,7 +295,10 @@ function invalidateHttpCache($username = '') { function listUsers() { $final_list = array(); $base_path = join_path(DATA_PATH, 'users'); - $dir_list = scandir($base_path); + $dir_list = array_values(array_diff( + scandir($base_path), + array('..', '.', '_') + )); foreach ($dir_list as $file) { if ($file[0] !== '.' && is_dir(join_path($base_path, $file)) && file_exists(join_path($base_path, $file, 'config.php'))) { $final_list[] = $file; -- cgit v1.2.3