// We will only change the url to an ip address if there is no existing setting
if(! x($url))
- $url = set_config('system','url',$a->get_baseurl());
- if((! link_compare($url,$a->get_baseurl())) && (! preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$a->get_hostname)))
- $url = set_config('system','url',$a->get_baseurl());
+ $url = set_config('system','url',App::get_baseurl());
+ if((! link_compare($url,App::get_baseurl())) && (! preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$a->get_hostname)))
+ $url = set_config('system','url',App::get_baseurl());
return;
}
if ($a->max_processes_reached() OR $a->maxload_reached()) {
header($_SERVER["SERVER_PROTOCOL"].' 503 Service Temporarily Unavailable');
header('Retry-After: 120');
- header('Refresh: 120; url='.$a->get_baseurl()."/".$a->query_string);
+ header('Refresh: 120; url='.App::get_baseurl()."/".$a->query_string);
die("System is currently unavailable. Please try again later");
}
if (get_config('system','force_ssl') AND ($a->get_scheme() == "http") AND
(intval(get_config('system','ssl_policy')) == SSL_POLICY_FULL) AND
- (substr($a->get_baseurl(), 0, 8) == "https://")) {
+ (substr(App::get_baseurl(), 0, 8) == "https://")) {
header("HTTP/1.1 302 Moved Temporarily");
- header("Location: ".$a->get_baseurl()."/".$a->query_string);
+ header("Location: ".App::get_baseurl()."/".$a->query_string);
exit();
}
*
*/
-// header('Link: <' . $a->get_baseurl() . '/amcd>; rel="acct-mgmt";');
+// header('Link: <' . App::get_baseurl() . '/amcd>; rel="acct-mgmt";');
if(x($_COOKIE["Friendica"]) || (x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
require("include/auth.php");
if((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']);
- goaway($a->get_baseurl() . $_SERVER['REQUEST_URI']);
+ goaway(App::get_baseurl() . $_SERVER['REQUEST_URI']);
}
logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
file_tag_unsave_file(local_user(),$item_id,$term, $category);
if(x($_SESSION,'return_url'))
- goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
+ goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
killme();
}
$request = $ret["request"];
$tpl = get_markup_template('dfrn_request.tpl');
} else {
- $request = $a->get_baseurl()."/follow";
+ $request = App::get_baseurl()."/follow";
$tpl = get_markup_template('auto_request.tpl');
}
notice($result['message']);
goaway($return_url);
} elseif ($result['cid'])
- goaway($a->get_baseurl().'/contacts/'.$result['cid']);
+ goaway(App::get_baseurl().'/contacts/'.$result['cid']);
info( t('Contact added').EOL);
if(strstr($return_url,'contacts'))
- goaway($a->get_baseurl().'/contacts/'.$contact_id);
+ goaway(App::get_baseurl().'/contacts/'.$contact_id);
goaway($return_url);
// NOTREACHED
if ($level>$lastlevel) $toc.="<ul>";
$idnum[$level]++;
$id = implode("_", array_slice($idnum,1,$level));
- $href = $a->get_baseurl()."/help/{$filename}#{$id}";
+ $href = App::get_baseurl()."/help/{$filename}#{$id}";
$toc .= "<li><a href='{$href}'>".strip_tags($line)."</a></li>";
$line = "<a name='{$id}'></a>".$line;
$lastlevel = $level;
$a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget();
- $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
+ $_SESSION['return_url'] = App::get_baseurl() . '/' . $a->cmd;
$r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
intval(local_user())
if(strlen(get_config('system','directory')))
$x = post_url(get_server().'/msearch', $params);
else
- $x = post_url($a->get_baseurl() . '/msearch', $params);
+ $x = post_url(App::get_baseurl() . '/msearch', $params);
$j = json_decode($x);
if (!count($match)) {
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
- $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;
+ $connlnk = App::get_baseurl() . '/follow/?url=' . $jj->url;
$photo_menu = array(
'profile' => array(t("View Profile"), zrl($jj->url)),
'follow' => array(t("Connect/Follow"), $connlnk)
}
if (local_user()) {
- $handle = $a->user['nickname'] . '@' . substr($a->get_baseurl(),strpos($a->get_baseurl(),'://')+3);
+ $handle = $a->user['nickname'] . '@' . substr(App::get_baseurl(),strpos(App::get_baseurl(),'://')+3);
}
if (remote_user()) {
$handle = $_SESSION['handle'];
$tpl = get_markup_template('removeme.tpl');
$o .= replace_macros($tpl, array(
- '$basedir' => $a->get_baseurl(),
+ '$basedir' => App::get_baseurl(),
'$hash' => $hash,
'$title' => t('Remove My Account'),
'$desc' => t('This will completely remove your account. Once this has been done it is not recoverable.'),
$post_type = (($item['resource-id']) ? t('photo') : t('status'));
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
- $link = xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
+ $link = xmlify('<link rel="alternate" type="text/html" href="' . App::get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
$body = $item['body'];
$obj = <<< EOT
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
- $plink = '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
+ $plink = '[url=' . App::get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink );
$arr['verb'] = $activity;