Browse Source

Merge branch 'FreshRSS/dev' into cli_update_user

Alexandre Alapetite 8 năm trước cách đây
mục cha
commit
03a99c2408
5 tập tin đã thay đổi với 9 bổ sung6 xóa
  1. 3 0
      CHANGELOG.md
  2. 2 2
      app/install.php
  3. 1 1
      cli/create-user.php
  4. 2 2
      cli/do-install.php
  5. 1 1
      p/api/greader.php

+ 3 - 0
CHANGELOG.md

@@ -8,6 +8,9 @@
 	* 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)
 
 
 ## 2017-06-03 FreshRSS 1.7.0

+ 2 - 2
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() {
 		<div class="form-group">
 			<label class="group-name" for="user"><?php echo _t('install.bdd.username'); ?></label>
 			<div class="group-controls">
-				<input type="text" id="user" name="user" maxlength="16" pattern="[0-9A-Za-z_.-]{1,16}" value="<?php echo isset($_SESSION['bd_user']) ? $_SESSION['bd_user'] : ''; ?>" tabindex="3" />
+				<input type="text" id="user" name="user" maxlength="64" pattern="[0-9A-Za-z_.-]{1,64}" value="<?php echo isset($_SESSION['bd_user']) ? $_SESSION['bd_user'] : ''; ?>" tabindex="3" />
 			</div>
 		</div>
 

+ 1 - 1
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();

+ 2 - 2
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'), "<?php\n return " . var_export($config, true) . ";\n") === false) {

+ 1 - 1
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()),