Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/private/App/AppStore/Fetcher/AppFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ protected function fetch($ETag, $content, $allowUnstable = false) {
$phpVersion = $versionParser->getVersion($release['rawPhpVersionSpec']);
$minPhpVersion = $phpVersion->getMinimumVersion();
$maxPhpVersion = $phpVersion->getMaximumVersion();
$minPhpFulfilled = $minPhpVersion === '' || $this->compareVersion->isCompatible(
$minPhpFulfilled = $minPhpVersion === '' || version_compare(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use OC\App\DependencyAnalyzer instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a look at that class and especially its analyzePhpVersion method. It seems to me that using it would be an over-complicated way of doing what version_compare already does…

Maybe using OC\App\DependencyAnalyzer would be better for consistency with what is done in other parts of Nextcloud, but in that case I would have to leave that to Nextcloud developers who know the code base better than I do. I am simply proposing a no-brainer patch to fix rapidly what is in my opinion a pretty serious issue, as it makes a whole range of apps impossible to install — including security-related apps such as twofactor_totp and twofactor_u2f.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry didn't check the author. Let's bring in @ChristophWurst

PHP_VERSION,
$minPhpVersion,
'>='
);
$maxPhpFulfilled = $maxPhpVersion === '' || $this->compareVersion->isCompatible(
$maxPhpFulfilled = $maxPhpVersion === '' || version_compare(
PHP_VERSION,
$maxPhpVersion,
'<='
Expand Down