зеркало из https://github.com/nextcloud/server.git
Move to str_starts_with
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Родитель
306d7829b5
Коммит
f0a0bfaaee
|
@ -472,11 +472,11 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
|
||||
if ($this->offsetExists($name)) {
|
||||
return parent::query($name);
|
||||
} elseif ($this->appName === 'settings' && strpos($name, 'OC\\Settings\\') === 0) {
|
||||
} elseif ($this->appName === 'settings' && str_starts_with($name, 'OC\\Settings\\')) {
|
||||
return parent::query($name);
|
||||
} elseif ($this->appName === 'core' && strpos($name, 'OC\\Core\\') === 0) {
|
||||
} elseif ($this->appName === 'core' && str_starts_with($name, 'OC\\Core\\')) {
|
||||
return parent::query($name);
|
||||
} elseif (strpos($name, \OC\AppFramework\App::buildAppNamespace($this->appName) . '\\') === 0) {
|
||||
} elseif (str_starts_with($name, \OC\AppFramework\App::buildAppNamespace($this->appName) . '\\')) {
|
||||
return parent::query($name);
|
||||
}
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ class ServerContainer extends SimpleContainer {
|
|||
public function query(string $name, bool $autoload = true) {
|
||||
$name = $this->sanitizeName($name);
|
||||
|
||||
if (strpos($name, 'OCA\\') !== 0) {
|
||||
if (str_starts_with($name, 'OCA\\')) {
|
||||
// Skip server container query for app namespace classes
|
||||
try {
|
||||
return parent::query($name, false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче