Skip to content

Commit

Permalink
Merge pull request #29427 from owncloud/stable10-3a057bef987bf8e5fdb0…
Browse files Browse the repository at this point in the history
…cfdaee73e75b5503b6cb

[stable10] use efficient startsWith implementation, don't check if ke…
  • Loading branch information
Vincent Petry authored Nov 6, 2017
2 parents 4c40c47 + ca0803f commit 97c5a7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/private/AppFramework/Utility/SimpleContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public function resolve($name) {
*/
public function query($name) {
$name = $this->sanitizeName($name);
if ($this->offsetExists($name)) {
try {
return $this->offsetGet($name);
} else {
} catch (\InvalidArgumentException $ex) {
$object = $this->resolve($name);
$this->registerService($name, function () use ($object) {
return $object;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/ServerContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function query($name) {

// In case the service starts with OCA\ we try to find the service in
// the apps container first.
if (strpos($name, 'OCA\\') === 0 && substr_count($name, '\\') >= 2) {
if (strrpos($name, 'OCA\\', -strlen($name)) !== false && substr_count($name, '\\') >= 2) {
$segments = explode('\\', $name);
$appContainer = $this->getAppContainer(strtolower($segments[1]));
try {
Expand Down

0 comments on commit 97c5a7c

Please sign in to comment.