X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=d76351b97ac6a9db60470c9b7d999836ece1f799;hb=12a71f0155784890d8d0d2da4899fdb43953f036;hp=2330bc118586026f119e80c0c3a5596d171a58f4;hpb=87f2d185541eeb2475c16c844b172c5fa89a6527;p=friendica.git diff --git a/src/App.php b/src/App.php index 2330bc1185..d76351b97a 100644 --- a/src/App.php +++ b/src/App.php @@ -212,12 +212,6 @@ class App . $this->basepath . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR . $this->basepath); - - if (is_array($_SERVER['argv']) && $_SERVER['argc'] > 1 && substr(end($_SERVER['argv']), 0, 4) == 'http') { - $this->set_baseurl(array_pop($_SERVER['argv'])); - $_SERVER['argc'] --; - } - if ((x($_SERVER, 'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'], 0, 9) === 'pagename=') { $this->query_string = substr($_SERVER['QUERY_STRING'], 9); @@ -868,9 +862,6 @@ class App array_unshift($args, ((x($this->config, 'php_path')) && (strlen($this->config['php_path'])) ? $this->config['php_path'] : 'php')); - // add baseurl to args. cli scripts can't construct it - $args[] = $this->get_baseurl(); - for ($x = 0; $x < count($args); $x ++) { $args[$x] = escapeshellarg($args[$x]); } @@ -1056,4 +1047,24 @@ class App unset($this->config[$uid][$cat][$k]); } } + + /** + * Generates the site's default sender email address + * + * @return string + */ + public function getSenderEmailAddress() + { + $sender_email = Config::get('config', 'sender_email'); + if (empty($sender_email)) { + $hostname = $this->get_hostname(); + if (strpos($hostname, ':')) { + $hostname = substr($hostname, 0, strpos($hostname, ':')); + } + + $sender_email = 'noreply@' . $hostname; + } + + return $sender_email; + } }