Skip to content

Commit 754939b

Browse files
author
Bohdan Korablov
committed
MAGETWO-56317: [GitHub] -[2.1.0] underscore in site url breaks admin redirect - The page isn't redirecting properly #5809
1 parent 334ddd7 commit 754939b

File tree

1 file changed

+10
-40
lines changed

1 file changed

+10
-40
lines changed

setup/src/Magento/Setup/Console/Command/InstallStoreConfigurationCommand.php

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ public function getOptionsList()
205205
public function validate(InputInterface $input)
206206
{
207207
$errors = [];
208+
$errorMsg = '';
208209
$options = $input->getOptions();
209210
foreach ($options as $key => $value) {
210211
if (!$value) {
@@ -220,92 +221,61 @@ public function validate(InputInterface $input)
220221
StoreConfigurationDataMapper::KEY_BASE_URL,
221222
['http', 'https']
222223
);
223-
if ($errorMsg !== '') {
224-
$errors[] = $errorMsg;
225-
}
224+
226225
break;
227226
case StoreConfigurationDataMapper::KEY_LANGUAGE:
228227
$errorMsg = $this->validateCodes(
229228
$this->localeValidator,
230229
$value,
231230
StoreConfigurationDataMapper::KEY_LANGUAGE
232231
);
233-
if ($errorMsg !== '') {
234-
$errors[] = $errorMsg;
235-
}
236232
break;
237233
case StoreConfigurationDataMapper::KEY_TIMEZONE:
238234
$errorMsg = $this->validateCodes(
239235
$this->timezoneValidator,
240236
$value,
241237
StoreConfigurationDataMapper::KEY_TIMEZONE
242238
);
243-
if ($errorMsg !== '') {
244-
$errors[] = $errorMsg;
245-
}
246239
break;
247240
case StoreConfigurationDataMapper::KEY_CURRENCY:
248241
$errorMsg = $this->validateCodes(
249242
$this->currencyValidator,
250243
$value,
251244
StoreConfigurationDataMapper::KEY_CURRENCY
252245
);
253-
if ($errorMsg !== '') {
254-
$errors[] = $errorMsg;
255-
}
256246
break;
257247
case StoreConfigurationDataMapper::KEY_USE_SEF_URL:
258248
$errorMsg = $this->validateBinaryValue($value, StoreConfigurationDataMapper::KEY_USE_SEF_URL);
259-
if ($errorMsg !== '') {
260-
$errors[] = $errorMsg;
261-
}
262249
break;
263250
case StoreConfigurationDataMapper::KEY_IS_SECURE:
264251
$errorMsg = $this->validateBinaryValue($value, StoreConfigurationDataMapper::KEY_IS_SECURE);
265-
if ($errorMsg !== '') {
266-
$errors[] = $errorMsg;
267-
}
268252
break;
269253
case StoreConfigurationDataMapper::KEY_BASE_URL_SECURE:
270-
try {
271-
$errorMsg = $this->validateUrl(
272-
$value,
273-
StoreConfigurationDataMapper::KEY_BASE_URL_SECURE,
274-
['https']
275-
);
276-
if ($errorMsg !== '') {
277-
$errors[] = $errorMsg;
278-
}
279-
} catch (LocalizedException $e) {
280-
$errors[] = '<error>' . 'Command option \'' . StoreConfigurationDataMapper::KEY_BASE_URL_SECURE
281-
. '\': ' . $e->getLogMessage() .'</error>';
282-
}
254+
$errorMsg = $this->validateUrl(
255+
$value,
256+
StoreConfigurationDataMapper::KEY_BASE_URL_SECURE,
257+
['https']
258+
);
283259
break;
284260
case StoreConfigurationDataMapper::KEY_IS_SECURE_ADMIN:
285261
$errorMsg = $this->validateBinaryValue($value, StoreConfigurationDataMapper::KEY_IS_SECURE_ADMIN);
286-
if ($errorMsg !== '') {
287-
$errors[] = $errorMsg;
288-
}
289262
break;
290263
case StoreConfigurationDataMapper::KEY_ADMIN_USE_SECURITY_KEY:
291264
$errorMsg = $this->validateBinaryValue(
292265
$value,
293266
StoreConfigurationDataMapper::KEY_ADMIN_USE_SECURITY_KEY
294267
);
295-
if ($errorMsg !== '') {
296-
$errors[] = $errorMsg;
297-
}
298268
break;
299269
case StoreConfigurationDataMapper::KEY_JS_LOGGING:
300270
$errorMsg = $this->validateBinaryValue(
301271
$value,
302272
StoreConfigurationDataMapper::KEY_JS_LOGGING
303273
);
304-
if ($errorMsg !== '') {
305-
$errors[] = $errorMsg;
306-
}
307274
break;
308275
}
276+
if ($errorMsg !== '') {
277+
$errors[] = $errorMsg;
278+
}
309279
}
310280
return $errors;
311281
}

0 commit comments

Comments
 (0)