Просмотр исходного кода

Fix wrong order of args in extension compatibility check (#9445)

See https://www.php.net/manual/function.version-compare.php

The extension's minimum required FreshRSS version must be compared against the currently running version, not the other way around.

Assuming the running FreshRSS version is `1.30.1`:

| Minimum required version | Expected status | Before this fix | After this fix |
|---|---|---|---|
| `1.27.0` | ✅ Compatible | ❌ Incompatible | ✅ Compatible |
| `1.30.1` | ✅ Compatible | ✅ Compatible | ✅ Compatible |
| `1.31.0` | ❌ Incompatible | ✅ Compatible | ❌ Incompatible |
Inverle 1 день назад
Родитель
Сommit
ed34f6a21d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      app/Controllers/extensionController.php

+ 1 - 1
app/Controllers/extensionController.php

@@ -112,7 +112,7 @@ class FreshRSS_extension_Controller extends FreshRSS_ActionController {
 
 		return array_map(static function (array $extension) {
 			if ($extension['compatibility'] !== '✔') {
-				$extension['compatibility'] = version_compare($extension['compatibility'], FRESHRSS_VERSION, '>=') ? '✔' : '✘';
+				$extension['compatibility'] = version_compare(FRESHRSS_VERSION, $extension['compatibility'], '>=') ? '✔' : '✘';
 			}
 			return $extension;
 		}, $extensions);