Url: Do not try to set attributes in method fromPath if not needed
refs #12133
This commit is contained in:
parent
b4aca4737b
commit
08719b0522
|
@ -214,20 +214,23 @@ class Url
|
||||||
if (isset($urlParts['fragment'])) {
|
if (isset($urlParts['fragment'])) {
|
||||||
$urlObject->setAnchor($urlParts['fragment']);
|
$urlObject->setAnchor($urlParts['fragment']);
|
||||||
}
|
}
|
||||||
if (isset($urlParts['host'])) {
|
|
||||||
$urlObject->setHost($urlParts['host']);
|
if (isset($urlParts['user']) || $urlObject->isExternal()) {
|
||||||
}
|
if (isset($urlParts['user'])) {
|
||||||
if (isset($urlParts['port'])) {
|
$urlObject->setUsername($urlParts['user']);
|
||||||
$urlObject->setPort($urlParts['port']);
|
}
|
||||||
}
|
if (isset($urlParts['host'])) {
|
||||||
if (isset($urlParts['scheme'])) {
|
$urlObject->setHost($urlParts['host']);
|
||||||
$urlObject->setScheme($urlParts['scheme']);
|
}
|
||||||
}
|
if (isset($urlParts['port'])) {
|
||||||
if (isset($urlParts['user'])) {
|
$urlObject->setPort($urlParts['port']);
|
||||||
$urlObject->setUsername($urlParts['user']);
|
}
|
||||||
}
|
if (isset($urlParts['scheme'])) {
|
||||||
if (isset($urlParts['pass'])) {
|
$urlObject->setScheme($urlParts['scheme']);
|
||||||
$urlObject->setPassword($urlParts['pass']);
|
}
|
||||||
|
if (isset($urlParts['pass'])) {
|
||||||
|
$urlObject->setPassword($urlParts['pass']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$urlObject->setParams($params);
|
$urlObject->setParams($params);
|
||||||
|
|
Loading…
Reference in New Issue