Kaynağa Gözat

Fix git update error message (#3645)

#fix https://github.com/FreshRSS/FreshRSS/issues/3644
Alexandre Alapetite 4 yıl önce
ebeveyn
işleme
54e0a6e553
1 değiştirilmiş dosya ile 4 ekleme ve 3 silme
  1. 4 3
      app/Controllers/updateController.php

+ 4 - 3
app/Controllers/updateController.php

@@ -48,7 +48,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
 		try {
 			exec('git fetch --prune', $output, $return);
 			if ($return == 0) {
-				unset($output);
+				$output = [];
 				exec('git status -sb --porcelain remote', $output, $return);
 			} else {
 				$line = is_array($output) ? implode('; ', $output) : $output;
@@ -71,14 +71,15 @@ class FreshRSS_update_Controller extends Minz_ActionController {
 		try {
 			exec('git fetch --prune', $output, $return);
 			if ($return == 0) {
-				unset($output);
+				$output = [];
 				exec('git reset --hard FETCH_HEAD', $output, $return);
 			}
 
+			$output = [];
 			self::migrateToGitEdge();
 		} catch (Exception $e) {
 			Minz_Log::warning('Git error: ' . $e->getMessage());
-			if ($output == '') {
+			if (empty($output)) {
 				$output = $e->getMessage();
 			}
 			$return = 1;