summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-10 00:27:05 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-10 00:27:05 +0100
commitf8e020ff87df46520fce0d8847e1a5c55c11ca3f (patch)
treebfbe601c8031cf7da4ac66ca1dc5141f38303f17 /lib/private
parenta8ea3acafa1dd634060ad6f1dd6e8552660945f9 (diff)
parentfe04451cb1fdda99b79798d21f0a229f99224250 (diff)
downloadnextcloud-server-f8e020ff87df46520fce0d8847e1a5c55c11ca3f.tar.gz
nextcloud-server-f8e020ff87df46520fce0d8847e1a5c55c11ca3f.zip
Merge pull request #20390 from owncloud/appcheckcode-no-duplicate-requirement
Do not allow two different version requirements
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/app/codechecker/infochecker.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/app/codechecker/infochecker.php b/lib/private/app/codechecker/infochecker.php
index 91580bde07d..24835d8148f 100644
--- a/lib/private/app/codechecker/infochecker.php
+++ b/lib/private/app/codechecker/infochecker.php
@@ -77,6 +77,21 @@ class InfoChecker extends BasicEmitter {
$info = $this->infoParser->parse($appPath . '/appinfo/info.xml');
+ if (isset($info['dependencies']['owncloud']['@attributes']['min-version']) && ($info['requiremin'] || $info['require'])) {
+ $this->emit('InfoChecker', 'duplicateRequirement', ['min']);
+ $errors[] = [
+ 'type' => 'duplicateRequirement',
+ 'field' => 'min',
+ ];
+ }
+ if (isset($info['dependencies']['owncloud']['@attributes']['max-version']) && $info['requiremax']) {
+ $this->emit('InfoChecker', 'duplicateRequirement', ['max']);
+ $errors[] = [
+ 'type' => 'duplicateRequirement',
+ 'field' => 'max',
+ ];
+ }
+
foreach ($info as $key => $value) {
if(is_array($value)) {
$value = json_encode($value);