Browse Source

Fix problem with starred files for import/export

Improve guessFileType method

See https://github.com/marienfressinaud/FreshRSS/issues/494
Marien Fressinaud 11 years ago
parent
commit
ae54a14386
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/Controllers/importExportController.php

+ 2 - 1
app/Controllers/importExportController.php

@@ -116,7 +116,8 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {
 		} elseif (substr_compare($filename, '.opml', -5) === 0 ||
 		          substr_compare($filename, '.xml', -4) === 0) {
 			return 'opml';
-		} elseif (strcmp($filename, 'starred.json') === 0) {
+		} elseif (substr_compare($filename, '.json', -5) === 0 &&
+		          strpos($filename, 'starred') !== false) {
 			return 'json_starred';
 		} elseif (substr_compare($filename, '.json', -5) === 0 &&
 		          strpos($filename, 'feed_') === 0) {