Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/engine/PhabricatorMailEmailEngine.php
Show First 20 Lines • Show All 501 Lines • ▼ Show 20 Lines | private function newEmailAddress($address, $name = null) { | ||||
} | } | ||||
return $object; | return $object; | ||||
} | } | ||||
public function newDefaultEmailAddress() { | public function newDefaultEmailAddress() { | ||||
$raw_address = PhabricatorEnv::getEnvConfig('metamta.default-address'); | $raw_address = PhabricatorEnv::getEnvConfig('metamta.default-address'); | ||||
if (!strlen($raw_address)) { | if (!$raw_address) { | ||||
$domain = $this->newMailDomain(); | $domain = $this->newMailDomain(); | ||||
$raw_address = "noreply@{$domain}"; | $raw_address = "noreply@{$domain}"; | ||||
} | } | ||||
valerio.bozzolan: Yep I confirm that I know PHP and I know what is going on up here. I confirm that the value "0"… | |||||
$address = new PhutilEmailAddress($raw_address); | $address = new PhutilEmailAddress($raw_address); | ||||
if (!phutil_nonempty_string($address->getDisplayName())) { | if (!phutil_nonempty_string($address->getDisplayName())) { | ||||
$address->setDisplayName(PlatformSymbols::getPlatformServerName()); | $address->setDisplayName(PlatformSymbols::getPlatformServerName()); | ||||
} | } | ||||
return $address; | return $address; | ||||
} | } | ||||
public function newVoidEmailAddress() { | public function newVoidEmailAddress() { | ||||
return $this->newDefaultEmailAddress(); | return $this->newDefaultEmailAddress(); | ||||
} | } | ||||
private function newMailDomain() { | private function newMailDomain() { | ||||
$domain = PhabricatorEnv::getEnvConfig('metamta.reply-handler-domain'); | $domain = PhabricatorEnv::getEnvConfig('metamta.reply-handler-domain'); | ||||
if (strlen($domain)) { | if ($domain) { | ||||
return $domain; | return $domain; | ||||
} | } | ||||
Done Inline ActionsYep I confirm that I know PHP and I know what is going on up here. I confirm that the value "0" does not make any sense in this string and that is why this simple if is sufficient. valerio.bozzolan: Yep I confirm that I know PHP and I know what is going on up here. I confirm that the value "0"… | |||||
$install_uri = PhabricatorEnv::getURI('/'); | $install_uri = PhabricatorEnv::getURI('/'); | ||||
$install_uri = new PhutilURI($install_uri); | $install_uri = new PhutilURI($install_uri); | ||||
return $install_uri->getDomain(); | return $install_uri->getDomain(); | ||||
} | } | ||||
private function filterHeaders(array $headers, $must_encrypt) { | private function filterHeaders(array $headers, $must_encrypt) { | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
Yep I confirm that I know PHP and I know what is going on up here. I confirm that the value "0" does not make any sense in this string and that is why this simple if is sufficient.