aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/App
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-26 15:40:44 +0100
committerGitHub <noreply@github.com>2018-01-26 15:40:44 +0100
commit4c38d1ed01a180b2c086571ab1b6167c173c203b (patch)
treec0f5ffb382534fb468193f453499aa69c4aa5cf9 /lib/private/App
parentca493ab5b1288d53f203d74117a8e636a606e633 (diff)
parent9ff51aafc518460e6c45996f09e9fe74e5f8d2e8 (diff)
downloadnextcloud-server-4c38d1ed01a180b2c086571ab1b6167c173c203b.tar.gz
nextcloud-server-4c38d1ed01a180b2c086571ab1b6167c173c203b.zip
Merge pull request #8054 from nextcloud/substr-use-index
Use index based string access for substr with length of 1
Diffstat (limited to 'lib/private/App')
-rw-r--r--lib/private/App/AppStore/Version/VersionParser.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/private/App/AppStore/Version/VersionParser.php b/lib/private/App/AppStore/Version/VersionParser.php
index 3924b8aea16..cdbb62ffbc5 100644
--- a/lib/private/App/AppStore/Version/VersionParser.php
+++ b/lib/private/App/AppStore/Version/VersionParser.php
@@ -63,11 +63,10 @@ class VersionParser {
if(!$this->isValidVersionString($firstVersionNumber)) {
break;
}
- if(substr($firstVersion, 0, 1) === '>') {
+ if(strpos($firstVersion, '>') === 0) {
return new Version($firstVersionNumber, '');
- } else {
- return new Version('', $firstVersionNumber);
}
+ return new Version('', $firstVersionNumber);
case 2:
if(!$this->isValidVersionString($firstVersionNumber) || !$this->isValidVersionString($secondVersionNumber)) {
break;