From c3f2302be71d4b3bc2dd4cc67dd16c4505203498 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 22 Jul 2017 15:47:13 +0200 Subject: [PATCH 1/4] Update username constraints https://github.com/FreshRSS/FreshRSS/issues/1597 --- app/install.php | 4 ++-- cli/create-user.php | 2 +- cli/do-install.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/install.php b/app/install.php index 9e474ca73..cd276bb7b 100644 --- a/app/install.php +++ b/app/install.php @@ -124,7 +124,7 @@ function saveStep2() { $_SESSION['title'] = $system_default_config->title; $_SESSION['old_entries'] = param('old_entries', $user_default_config->old_entries); $_SESSION['auth_type'] = param('auth_type', 'form'); - $_SESSION['default_user'] = substr(preg_replace('/[^a-zA-Z0-9]/', '', param('default_user', '')), 0, 16); + $_SESSION['default_user'] = substr(preg_replace('/[^0-9a-zA-Z_]/', '', param('default_user', '')), 0, 38); $password_plain = param('passwordPlain', false); if ($password_plain !== false && cryptAvailable()) { @@ -631,7 +631,7 @@ function printStep3() {
- +
diff --git a/cli/create-user.php b/cli/create-user.php index c9e350c14..f44591cc9 100755 --- a/cli/create-user.php +++ b/cli/create-user.php @@ -18,7 +18,7 @@ if (empty($options['user'])) { } $username = $options['user']; if (!FreshRSS_user_Controller::checkUsername($username)) { - fail('FreshRSS error: invalid username “' . $username . '”'); + fail('FreshRSS error: invalid username “' . $username . '”! Must be matching ' . FreshRSS_user_Controller::USERNAME_PATTERN); } $usernames = listUsers(); diff --git a/cli/do-install.php b/cli/do-install.php index 143ca5c3e..54e3c3d4f 100755 --- a/cli/do-install.php +++ b/cli/do-install.php @@ -81,11 +81,11 @@ if ($requirements['all'] !== 'ok') { } if (!FreshRSS_user_Controller::checkUsername($options['default_user'])) { - fail('FreshRSS invalid default username (must be ASCII alphanumeric): ' . $options['default_user']); + fail('FreshRSS error: invalid default username “' . $options['default_user'] . '”! Must be matching ' . FreshRSS_user_Controller::USERNAME_PATTERN); } if (isset($options['auth_type']) && !in_array($options['auth_type'], array('form', 'http_auth', 'none'))) { - fail('FreshRSS invalid authentication method (auth_type must be one of { form, http_auth, none }: ' . $options['auth_type']); + fail('FreshRSS invalid authentication method (auth_type must be one of { form, http_auth, none }): ' . $options['auth_type']); } if (file_put_contents(join_path(DATA_PATH, 'config.php'), " Date: Sun, 23 Jul 2017 11:51:46 +0200 Subject: [PATCH 2/4] Fix timestamp format with PostgreSQL for EasyRSS https://github.com/Alkarex/EasyRSS/issues/31 --- p/api/greader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p/api/greader.php b/p/api/greader.php index 6b9ea4526..7f6f0b04f 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -503,7 +503,7 @@ function streamContents($path, $include_target, $start_time, $count, $order, $ex $item = array( 'id' => /*'tag:google.com,2005:reader/item/' .*/ dec2hex($entry->id()), //64-bit hexa http://code.google.com/p/google-reader-api/wiki/ItemId 'crawlTimeMsec' => substr($entry->id(), 0, -3), - 'timestampUsec' => $entry->id(), //EasyRSS + 'timestampUsec' => '' . $entry->id(), //EasyRSS 'published' => $entry->date(true), 'title' => $entry->title(), 'summary' => array('content' => $entry->content()), From 8b834527a2518703539857fac185ddace422e5b0 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 23 Jul 2017 18:33:52 +0200 Subject: [PATCH 3/4] Readme 1597 https://github.com/FreshRSS/FreshRSS/issues/1597 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be38141d5..aad47721a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ * Korean [#1578](https://github.com/FreshRSS/FreshRSS/pull/1578) * Bug fixing * PHP 7.1 compatibility for the API [#1584](https://github.com/FreshRSS/FreshRSS/issues/1584), [#1594](https://github.com/FreshRSS/FreshRSS/pull/1594) +* Misc. + * Allow longer database usernames [#1597](https://github.com/FreshRSS/FreshRSS/issues/1597) ## 2017-06-03 FreshRSS 1.7.0 From d0d0861e024efcedd388cb02cbada01d9eb984d5 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 24 Jul 2017 08:54:45 +0200 Subject: [PATCH 4/4] Changelog 1603 https://github.com/Alkarex/EasyRSS/issues/31 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aad47721a..22c11be1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Korean [#1578](https://github.com/FreshRSS/FreshRSS/pull/1578) * Bug fixing * PHP 7.1 compatibility for the API [#1584](https://github.com/FreshRSS/FreshRSS/issues/1584), [#1594](https://github.com/FreshRSS/FreshRSS/pull/1594) + * Fix API compatibility bug between PostgreSQL and EasyRSS [#1603](https://github.com/FreshRSS/FreshRSS/pull/1603) * Misc. * Allow longer database usernames [#1597](https://github.com/FreshRSS/FreshRSS/issues/1597)