X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=ed7c9956cf536fd61124be595bc86fecf4248ce4;hb=3c076b53fe0fb3d5e625b773a5e4723dece0a057;hp=0b6aed2e70128ed6675993ccdad9037f0c2fdc00;hpb=c6b28ee5edfee53aa5e9dc8d2576eb07b1accac4;p=friendica.git
diff --git a/boot.php b/boot.php
index 0b6aed2e70..ed7c9956cf 100644
--- a/boot.php
+++ b/boot.php
@@ -3,7 +3,7 @@
set_time_limit(0);
define ( 'BUILD_ID', 1039 );
-define ( 'FRIENDIKA_VERSION', '2.10.0907' );
+define ( 'FRIENDIKA_VERSION', '2.10.0909' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
define ( 'EOL', "
\r\n" );
@@ -40,6 +40,8 @@ define ( 'REGISTER_OPEN', 2 );
/**
* relationship types
+ * When used in contact records, this indicates that 'uid' has
+ * this relationship with contact['name']
*/
define ( 'REL_VIP', 1);
@@ -197,6 +199,7 @@ class App {
public $interactive = true;
public $plugins;
public $apps;
+ public $identities;
private $scheme;
private $hostname;
@@ -267,9 +270,11 @@ class App {
* Just spit out the contents and exit.
*/
- if($this->cmd === '.well-known/host-meta')
+ if($this->cmd === '.well-known/host-meta') {
require_once('include/hostxrd.php');
-
+ hostxrd($this->hostname);
+ // NOTREACHED
+ }
/**
* See if there is any page number information, and initialise
@@ -298,7 +303,7 @@ class App {
}
function set_baseurl($url) {
- $parsed = parse_url($url);
+ $parsed = @parse_url($url);
$this->baseurl = $url;
@@ -410,6 +415,7 @@ function x($s,$k = NULL) {
if(! function_exists('system_unavailable')) {
function system_unavailable() {
include('system_unavailable.php');
+ system_down();
killme();
}}
@@ -623,7 +629,7 @@ function fetch_url($url,$binary = false, &$redirects = 0) {
$matches = array();
preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
$url = trim(array_pop($matches));
- $url_parsed = parse_url($url);
+ $url_parsed = @parse_url($url);
if (isset($url_parsed)) {
$redirects++;
return fetch_url($url,$binary,$redirects);
@@ -695,7 +701,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0) {
$matches = array();
preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
$url = trim(array_pop($matches));
- $url_parsed = parse_url($url);
+ $url_parsed = @parse_url($url);
if (isset($url_parsed)) {
$redirects++;
return post_url($url,$binary,$headers,$redirects);
@@ -765,7 +771,12 @@ function escape_tags($string) {
if(! function_exists('login')) {
function login($register = false) {
$o = "";
- $register_html = (($register) ? load_view_file("view/register-link.tpl") : "");
+ $register_tpl = (($register) ? load_view_file("view/register-link.tpl") : "");
+
+ $register_html = replace_macros($register_tpl,array(
+ '$title' => t('Create a New Account'),
+ '$desc' => t('Register')
+ ));
$noid = get_config('system','no_openid');
if($noid) {
@@ -792,6 +803,7 @@ function login($register = false) {
}
$o = replace_macros($tpl,array(
+ '$logout' => t('Logout'),
'$register_html' => $register_html,
'$classname' => $classname,
'$namelabel' => $namelabel,
@@ -1414,7 +1426,7 @@ function lrdd($uri) {
// get the host meta file
- $host = parse_url($uri);
+ $host = @parse_url($uri);
if($host) {
$url = ((x($host,'scheme')) ? $host['scheme'] : 'http') . '://';
@@ -1675,7 +1687,7 @@ if(! function_exists('validate_url')) {
function validate_url(&$url) {
if(substr($url,0,4) != 'http')
$url = 'http://' . $url;
- $h = parse_url($url);
+ $h = @parse_url($url);
if(($h) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR))) {
return true;
@@ -1706,7 +1718,7 @@ function validate_email($addr) {
if(! function_exists('allowed_url')) {
function allowed_url($url) {
- $h = parse_url($url);
+ $h = @parse_url($url);
if(! $h) {
return false;
@@ -1932,8 +1944,10 @@ function get_mentions($item) {
$arr = explode(',',$item['tag']);
foreach($arr as $x) {
$matches = null;
- if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches))
+ if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) {
$o .= "\t\t" . '' . "\r\n";
+ $o .= "\t\t" . '' . "\r\n";
+ }
}
return $o;
}}
@@ -2060,7 +2074,7 @@ function aes_encrypt($val,$ky)
if(! function_exists('linkify')) {
function linkify($s) {
- $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' $1', $s);
+ $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%\$\!\+]*)/", ' $1', $s);
return($s);
}}
@@ -2405,10 +2419,15 @@ function link_compare($a,$b) {
if(! function_exists('prepare_body')) {
function prepare_body($item) {
+ return prepare_text($item['body']);
+}}
+
+if(! function_exists('prepare_text')) {
+function prepare_text($text) {
require_once('include/bbcode.php');
- $s = smilies(bbcode($item['body']));
+ $s = smilies(bbcode($text));
return $s;
}}
@@ -2427,13 +2446,19 @@ function prepare_body($item) {
* $cmd and string args are surrounded with ""
*/
-if(! function_exists('run_proc')) {
+if(! function_exists('proc_run')) {
function proc_run($cmd){
+
+ $a = get_app();
+
$args = func_get_args();
call_hooks("proc_run", $args);
+
+ if(count($args) && $args[0] === 'php')
+ $args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- foreach ($args as &$arg){
- if(is_string($arg)) $arg='"'.$arg.'"';
+ foreach ($args as $arg){
+ $arg = escapeshellarg($arg);
}
$cmdline = implode($args," ");
proc_close(proc_open($cmdline." &",array(),$foo));