Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/ssh/PhabricatorSSHWorkflow.php
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | abstract class PhabricatorSSHWorkflow | ||||
} | } | ||||
public function getRequestIdentifier() { | public function getRequestIdentifier() { | ||||
return $this->requestIdentifier; | return $this->requestIdentifier; | ||||
} | } | ||||
public function getSSHRemoteAddress() { | public function getSSHRemoteAddress() { | ||||
$ssh_client = getenv('SSH_CLIENT'); | $ssh_client = getenv('SSH_CLIENT'); | ||||
if (!strlen($ssh_client)) { | if (!phutil_nonempty_string($ssh_client)) { | ||||
valerio.bozzolan: This check has sense since we want a string and we want to report alien values from `getenv()`. | |||||
return null; | return null; | ||||
} | } | ||||
// TODO: When commands are proxied, the original remote address should | // TODO: When commands are proxied, the original remote address should | ||||
// also be proxied. | // also be proxied. | ||||
// This has the format "<ip> <remote-port> <local-port>". Grab the IP. | // This has the format "<ip> <remote-port> <local-port>". Grab the IP. | ||||
$remote_address = head(explode(' ', $ssh_client)); | $remote_address = head(explode(' ', $ssh_client)); | ||||
Show All 11 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
This check has sense since we want a string and we want to report alien values from getenv().