@@ -119,14 +119,24 @@ public function getFrontName($checkHost = false)
119
119
*
120
120
* @return bool
121
121
*/
122
- public function isHostBackend (): bool
122
+ public function isHostBackend ()
123
123
{
124
124
if (!$ this ->request ->getServer ('HTTP_HOST ' )) {
125
125
return false ;
126
126
}
127
127
128
- $ backendUrl = $ this ->getBackendUrl ();
129
-
128
+ if ($ this ->scopeConfig ->getValue (self ::XML_PATH_USE_CUSTOM_ADMIN_URL , ScopeInterface::SCOPE_STORE )) {
129
+ $ backendUrl = $ this ->scopeConfig ->getValue (self ::XML_PATH_CUSTOM_ADMIN_URL , ScopeInterface::SCOPE_STORE );
130
+ } else {
131
+ $ xmlPath = $ this ->request ->isSecure () ? Store::XML_PATH_SECURE_BASE_URL : Store::XML_PATH_UNSECURE_BASE_URL ;
132
+ $ backendUrl = $ this ->config ->getValue ($ xmlPath );
133
+ if ($ backendUrl === null ) {
134
+ $ backendUrl = $ this ->scopeConfig ->getValue (
135
+ $ xmlPath ,
136
+ ScopeInterface::SCOPE_STORE
137
+ );
138
+ }
139
+ }
130
140
$ this ->uri ->parse ($ backendUrl );
131
141
$ configuredHost = $ this ->uri ->getHost ();
132
142
if (!$ configuredHost ) {
@@ -144,20 +154,4 @@ public function isHostBackend(): bool
144
154
145
155
return strcasecmp ($ configuredHost , $ host ) === 0 ;
146
156
}
147
-
148
- /**
149
- * Retrieve backend URL
150
- * @return string|null
151
- */
152
- private function getBackendUrl (): ?string
153
- {
154
- if ($ this ->scopeConfig ->getValue (self ::XML_PATH_USE_CUSTOM_ADMIN_URL , ScopeInterface::SCOPE_STORE )) {
155
- return $ this ->scopeConfig ->getValue (self ::XML_PATH_CUSTOM_ADMIN_URL , ScopeInterface::SCOPE_STORE );
156
- }
157
-
158
- $ xmlPath = $ this ->request ->isSecure () ? Store::XML_PATH_SECURE_BASE_URL : Store::XML_PATH_UNSECURE_BASE_URL ;
159
- $ backendUrl = $ this ->config ->getValue ($ xmlPath );
160
- return $ backendUrl ?? $ this ->scopeConfig ->getValue ($ xmlPath , ScopeInterface::SCOPE_STORE );
161
- }
162
-
163
157
}
0 commit comments