Addressed warnings when reading from new files

There were warnings when reading extensions (trying to use e.g. README
and .gitignore as directories), and when reading update file.
https://github.com/FreshRSS/FreshRSS/issues/733
This commit is contained in:
Alexandre Alapetite
2015-01-19 13:54:57 +01:00
parent 8b94141fec
commit d30b3becfa
2 changed files with 7 additions and 1 deletions

View File

@@ -28,7 +28,10 @@ class FreshRSS_update_Controller extends Minz_ActionController {
);
} elseif (file_exists(UPDATE_FILENAME)) {
// There is an update file to apply!
$version = file_get_contents(join_path(DATA_PATH, 'last_update.txt'));
$version = @file_get_contents(join_path(DATA_PATH, 'last_update.txt'));
if (empty($version)) {
$version = 'unknown';
}
$this->view->update_to_apply = true;
$this->view->message = array(
'status' => 'good',