X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=boot.php;h=5d604599b75d682e50a1d93f502d6402fc5fc7e9;hb=b8479cc2f98bdd3b144cfda127c799ba4740fc83;hp=e4aa52b1a7050ca7a39b70b9acbcef4249aad9c6;hpb=78058c0a19e7682791282c89d93cd115d49f6ee6;p=friendica.git
diff --git a/boot.php b/boot.php
index e4aa52b1a7..5d604599b7 100644
--- a/boot.php
+++ b/boot.php
@@ -2,9 +2,9 @@
set_time_limit(0);
-define ( 'FRIENDIKA_VERSION', '2.1.934' );
-define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
-define ( 'DB_UPDATE_VERSION', 1045 );
+define ( 'FRIENDIKA_VERSION', '2.1.942' );
+define ( 'DFRN_PROTOCOL_VERSION', '2.2' );
+define ( 'DB_UPDATE_VERSION', 1047 );
define ( 'EOL', "
\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -437,15 +437,18 @@ function check_config(&$a) {
load_config('system');
- if(! x($_SERVER,'SERVER_NAME'))
- return;
-
$build = get_config('system','build');
if(! x($build))
$build = set_config('system','build',DB_UPDATE_VERSION);
$url = get_config('system','url');
- if(! x($url))
+
+ // if the url isn't set or the stored url is radically different
+ // than the currently visited url, store the current value accordingly.
+ // "Radically different" ignores common variations such as http vs https
+ // and www.example.com vs example.com.
+
+ if((! x($url)) || (! link_compare($url,$a->get_baseurl())))
$url = set_config('system','url',$a->get_baseurl());
if($build != DB_UPDATE_VERSION) {
@@ -1478,7 +1481,9 @@ function lrdd($uri) {
return array();
logger('lrdd: host_meta: ' . $xml, LOGGER_DATA);
- $h = simplexml_load_string($xml);
+
+ $h = parse_xml_string($xml);
+
$arr = convert_xml_element_to_array($h);
if(isset($arr['xrd']['property'])) {
@@ -1550,16 +1555,19 @@ function lrdd($uri) {
$headers = $a->get_curl_headers();
logger('lrdd: headers=' . $headers, LOGGER_DEBUG);
- require_once('library/HTML5/Parser.php');
- $dom = @HTML5_Parser::parse($html);
-
- if($dom) {
- $items = $dom->getElementsByTagName('link');
- foreach($items as $item) {
- $x = $item->getAttribute('rel');
- if($x == "lrdd") {
- $pagelink = $item->getAttribute('href');
- break;
+ // don't try and parse raw xml as html
+ if(! strstr($html,'getElementsByTagName('link');
+ foreach($items as $item) {
+ $x = $item->getAttribute('rel');
+ if($x == "lrdd") {
+ $pagelink = $item->getAttribute('href');
+ break;
+ }
}
}
}
@@ -1638,7 +1646,7 @@ function fetch_xrd_links($url) {
return array();
logger('fetch_xrd_links: ' . $xml, LOGGER_DATA);
- $h = simplexml_load_string($xml);
+ $h = parse_xml_string($xml);
$arr = convert_xml_element_to_array($h);
$links = array();
@@ -2022,7 +2030,7 @@ function contact_block() {
intval($shown)
);
if(count($r)) {
- $o .= '