]> git.mxchange.org Git - friendica.git/commitdiff
Merge
authorMichael <heluecht@pirati.ca>
Tue, 28 Apr 2020 08:00:38 +0000 (08:00 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 28 Apr 2020 08:00:38 +0000 (08:00 +0000)
src/Model/GServer.php
src/Model/Item.php
src/Module/Admin/Users.php
src/Network/Probe.php
src/Protocol/ActivityPub/Transmitter.php
src/Protocol/DFRN.php
src/Protocol/Diaspora.php
src/Util/XML.php
view/theme/frio/css/style.css
view/theme/frio/templates/jot.tpl
view/theme/frio/templates/searchbox.tpl

index 0f5f55ab671a19979fd4b1a02659d199a889fb24..bc189af9d6bb7567ff531884ed214a2aaaca44c9 100644 (file)
@@ -747,7 +747,7 @@ class GServer
                        return false;
                }
 
-               $xrd = XML::parseString($curlResult->getBody(), false);
+               $xrd = XML::parseString($curlResult->getBody());
                if (!is_object($xrd)) {
                        return false;
                }
@@ -796,13 +796,13 @@ class GServer
                DBA::close($gcontacts);
 
                $apcontacts = DBA::select('apcontact', ['url'], ['baseurl' => [$url, $serverdata['nurl']]]);
-               while ($gcontact = DBA::fetch($gcontacts)) {
+               while ($apcontact = DBA::fetch($apcontacts)) {
                        $contacts[Strings::normaliseLink($apcontact['url'])] = $apcontact['url'];
                }
                DBA::close($apcontacts);
 
                $pcontacts = DBA::select('contact', ['url', 'nurl'], ['uid' => 0, 'baseurl' => [$url, $serverdata['nurl']]]);
-               while ($gcontact = DBA::fetch($gcontacts)) {
+               while ($pcontact = DBA::fetch($pcontacts)) {
                        $contacts[$pcontact['nurl']] = $pcontact['url'];
                }
                DBA::close($pcontacts);
index bd8d03359ef3b19677d9ae23999c3a7b40dd4a59..97c96f6748b73f8ec6a16f3460216d398bfc29f6 100644 (file)
@@ -1249,8 +1249,8 @@ class Item
                        return;
                }
 
-               $xo = XML::parseString($item["object"], false);
-               $xt = XML::parseString($item["target"], false);
+               $xo = XML::parseString($item["object"]);
+               $xt = XML::parseString($item["target"]);
 
                if ($xt->type != Activity\ObjectType::NOTE) {
                        return;
index 002e6c5febdc503c0c28bc7dc434dca546116144..dca8c9c2e6bd716f9a93da8ed944778d15e2fa76 100644 (file)
@@ -206,7 +206,7 @@ class Users extends BaseAdmin
 
                        $e['register_date'] = Temporal::getRelativeDate($e['register_date']);
                        $e['login_date'] = Temporal::getRelativeDate($e['login_date']);
-                       $e['last-item'] = Temporal::getRelativeDate($e['last-item']);
+                       $e['lastitem_date'] = Temporal::getRelativeDate($e['last-item']);
                        $e['is_admin'] = in_array($e['email'], $adminlist);
                        $e['is_deletable'] = (intval($e['uid']) != local_user());
                        $e['deleted'] = ($e['account_removed'] ? Temporal::getRelativeDate($e['account_expires_on']) : False);
index b5991934b4912d16caeec3b6b0204ca3631cc43f..1e6d8406a12697b58bc181708705ede0d4310fbe 100644 (file)
@@ -160,7 +160,7 @@ class Probe
                $ssl_connection_error = ($curlResult->getErrorNumber() == CURLE_COULDNT_CONNECT) || ($curlResult->getReturnCode() == 0);
                if ($curlResult->isSuccess()) {
                        $xml = $curlResult->getBody();
-                       $xrd = XML::parseString($xml, false);
+                       $xrd = XML::parseString($xml, true);
                        if (!empty($url)) {
                                $host_url = 'https://' . $host;
                        } else {
@@ -185,7 +185,7 @@ class Probe
                        }
 
                        $xml = $curlResult->getBody();
-                       $xrd = XML::parseString($xml, false);
+                       $xrd = XML::parseString($xml, true);
                        $host_url = 'http://'.$host;
                }
                if (!is_object($xrd)) {
@@ -936,7 +936,7 @@ class Probe
                }
 
                // If it is not JSON, maybe it is XML
-               $xrd = XML::parseString($data, false);
+               $xrd = XML::parseString($data, true);
                if (!is_object($xrd)) {
                        Logger::log("No webfinger data retrievable for ".$url, Logger::DEBUG);
                        return false;
index db588ea6d9b14b7e5e254da6d57035bf27fb7617..8928b9435aab1fdc924ba25c41aaa153e7bfd939 100644 (file)
@@ -1408,8 +1408,8 @@ class Transmitter
         */
        private static function createAddTag($item, $data)
        {
-               $object = XML::parseString($item['object'], false);
-               $target = XML::parseString($item["target"], false);
+               $object = XML::parseString($item['object']);
+               $target = XML::parseString($item["target"]);
 
                $data['diaspora:guid'] = $item['guid'];
                $data['actor'] = $item['author-link'];
index f65a202f4818b8967b226346df7837503d0b1a11..4e5aac37d990d930bbda690e221d8e2d6c3a32dd 100644 (file)
@@ -805,7 +805,7 @@ class DFRN
                if ($activity) {
                        $entry = $doc->createElement($element);
 
-                       $r = XML::parseString($activity, false);
+                       $r = XML::parseString($activity);
                        if (!$r) {
                                return false;
                        }
@@ -831,7 +831,7 @@ class DFRN
                                        $r->link = preg_replace('/\<link(.*?)\"\>/', '<link$1"/>', $r->link);
 
                                        // XML does need a single element as root element so we add a dummy element here
-                                       $data = XML::parseString("<dummy>" . $r->link . "</dummy>", false);
+                                       $data = XML::parseString("<dummy>" . $r->link . "</dummy>");
                                        if (is_object($data)) {
                                                foreach ($data->link as $link) {
                                                        $attributes = [];
@@ -2101,7 +2101,7 @@ class DFRN
                if (!$verb) {
                        return;
                }
-               $xo = XML::parseString($item["object"], false);
+               $xo = XML::parseString($item["object"]);
 
                if (($xo->type == Activity\ObjectType::PERSON) && ($xo->id)) {
                        // somebody was poked/prodded. Was it me?
@@ -2224,8 +2224,8 @@ class DFRN
                        }
 
                        if (($item["verb"] == Activity::TAG) && ($item["object-type"] == Activity\ObjectType::TAGTERM)) {
-                               $xo = XML::parseString($item["object"], false);
-                               $xt = XML::parseString($item["target"], false);
+                               $xo = XML::parseString($item["object"]);
+                               $xt = XML::parseString($item["target"]);
 
                                if ($xt->type == Activity\ObjectType::NOTE) {
                                        $item_tag = Item::selectFirst(['id', 'uri-id', 'tag'], ['uri' => $xt->id, 'uid' => $importer["importer_uid"]]);
@@ -2413,7 +2413,7 @@ class DFRN
                $item["object"] = self::transformActivity($xpath, $object, "object");
 
                if (trim($item["object"]) != "") {
-                       $r = XML::parseString($item["object"], false);
+                       $r = XML::parseString($item["object"]);
                        if (isset($r->type)) {
                                $item["object-type"] = $r->type;
                        }
index 60cb4cf35a9772e35527a96e93cb534f25a927a1..62822950119c192b5547635285e464a02d6be847 100644 (file)
@@ -329,7 +329,7 @@ class Diaspora
         */
        private static function verifyMagicEnvelope($envelope)
        {
-               $basedom = XML::parseString($envelope);
+               $basedom = XML::parseString($envelope, true);
 
                if (!is_object($basedom)) {
                        Logger::log("Envelope is no XML file");
@@ -455,7 +455,7 @@ class Diaspora
                        $xml = $raw;
                }
 
-               $basedom = XML::parseString($xml);
+               $basedom = XML::parseString($xml, true);
 
                if (!is_object($basedom)) {
                        Logger::log('Received data does not seem to be an XML. Discarding. '.$xml);
index 9aba38910d6a7a0020e743d8f95ba30ec24690b2..4eed3a85f84eb511b0859521d75be1a34a99a760 100644 (file)
@@ -433,18 +433,26 @@ class XML
                }
        }
 
-       public static function parseString($s, $strict = true)
+       /**
+        * Parse XML string
+        *
+        * @param string  $s
+        * @param boolean $suppress_log
+        * @return Object
+        */
+       public static function parseString(string $s, bool $suppress_log = false)
        {
-               // the "strict" parameter is deactivated
                libxml_use_internal_errors(true);
 
                $x = @simplexml_load_string($s);
                if (!$x) {
-                       Logger::error('Error(s) while parsing XML string.', ['callstack' => System::callstack()]);
-                       foreach (libxml_get_errors() as $err) {
-                               Logger::info('libxml error', ['code' => $err->code, 'position' => $err->line . ":" . $err->column, 'message' => $err->message]);
+                       if (!$suppress_log) {
+                               Logger::error('Error(s) while parsing XML string.', ['callstack' => System::callstack()]);
+                               foreach (libxml_get_errors() as $err) {
+                                       Logger::info('libxml error', ['code' => $err->code, 'position' => $err->line . ":" . $err->column, 'message' => $err->message]);
+                               }
+                               Logger::debug('Erroring XML string', ['xml' => $s]);
                        }
-                       Logger::debug('Erroring XML string', ['xml' => $s]);
                        libxml_clear_errors();
                }
                return $x;
index 3dd4b8eb46e72e13c548f103eee5afafb3c7a436..88f290ab2cae2dee26f1d222d43f00be79885d32 100644 (file)
@@ -56,13 +56,13 @@ body a[name]:not([href]) {
     visibility: hidden;
 }
 
-body a:hover, .btn-link:hover, .btn:hover,
-body a:focus, .btn-link:focus, .btn:focus,
-body a:active, .btn-link:active, .btn:active,
-body a.active, .btn-link.active, .btn.active {
+body a:hover, .btn-link:hover,
+body a:focus, .btn-link:focus,
+body a:active, .btn-link:active,
+body a.active, .btn-link.active {
     color: $link_hover_color;
+       outline-color: $link_hover_color;;
     text-decoration: none;
-    outline: none;
 }
 
 .wall-item-container a:hover {
@@ -197,8 +197,8 @@ blockquote {
     padding: 8px 16px;
     color: inherit;
 }
-a.btn:hover {
-    color: #333;
+.btn:focus {
+       outline-color: $link_hover_color;
 }
 
 .btn-default {
@@ -219,17 +219,17 @@ a.btn:hover {
     padding: 1px 5px;
     font-size: 12px;
 }
-.btn-primary {
-    background: $nav_bg !important;
-    color: $btn_primary_color !important;
+.btn.btn-primary {
+    background: $nav_bg;
+    color: $btn_primary_color;
 }
-.btn-primary:hover, .btn-primary:focus {
+.btn.btn-primary:hover, .btn.btn-primary:focus {
+       color: $btn_primary_color;
     background: $btn_primary_hover_color;
     text-decoration: none;
 }
-.btn-primary:active, .btn-primary.active {
-    outline: 0;
-    background: $btn_primary_hover_color !important;
+.btn.btn-primary:active, .btn.btn-primary.active {
+    background: $btn_primary_hover_color;
 }
 
 .btn-primary.active.focus, .btn-primary.active:focus, .btn-primary.active:hover,
@@ -262,31 +262,7 @@ a.btn:hover {
 .btn-separator {
     border-left: 1px solid #777;
 }
-/*.btn-info {
-    background: #6fdbe8;
-    color: #fff!important;
-}
-.btn-info:hover, .btn-info:focus {
-    background: #59d6e4!important;
-    text-decoration: none;
-}
-.btn-info:active, .btn-info.active {
-    outline: 0;
-    background: #59d6e4;
-}*/
 
-.btn-main {
-    background: $link_color;
-    color: #fff!important;
-}
-.btn-main:hover, .btn-main:focus {
-    background: $link_hover_color !important;
-    text-decoration: none;
-}
-.btn-main:active, .btn-main.active {
-    outline: 0;
-    background: $link_hover_color;
-}
 .toggle.btn {
     border: 1px solid transparent;
 }
@@ -2202,19 +2178,13 @@ ul.dropdown-menu li:hover {
     box-shadow: none;
 }
 .form-control:focus {
-    /*border: 2px solid #6fdbe8;*/
     border: 2px solid $link_color;
-    outline: 0;
     box-shadow: none;
 }
 
-
 .checkbox input[type="checkbox"]:focus + label::before,
-.checkbox input[type="radio"]:focus + label::before {
-    /*border: 2px solid #6fdbe8;*/
-    border: 2px solid $link_color;
-    outline: 0;
-    box-shadow: none;
+.radio input[type="radio"]:focus + label::before {
+       outline-color: $link_hover_color;
 }
 
 /* Search form */
index 88130c1862aa15bb759fafdeff92fe4c3c0027dd..e0c602a289c82830db950968fc59b10012c6b3a5 100644 (file)
@@ -1,5 +1,5 @@
 {{* The button to open the jot - in This theme we move the button with js to the second nav bar *}}
-<a class="btn btn-sm btn-main pull-right" id="jotOpen" href="compose/{{$posttype}}{{if $content}}?body={{$content}}{{/if}}" aria-label="{{$new_post}}" title="{{$new_post}}"><i class="fa fa-pencil-square-o fa-2x"></i></a>
+<a class="btn btn-sm btn-primary pull-right" id="jotOpen" href="compose/{{$posttype}}{{if $content}}?body={{$content}}{{/if}}" aria-label="{{$new_post}}" title="{{$new_post}}"><i class="fa fa-pencil-square-o fa-2x"></i></a>
 
 <div id="jot-content">
        <div id="jot-sections">
index ced6fbbd388062f518fd633c4f40f967ffcb2ab1..945894252a60c4e1f0c3ba462c9f8723baa1f755 100644 (file)
@@ -46,7 +46,7 @@ Some parts of this template will be moved by js to other places (see theme.js) -
        </div>
 
 {{if $s}}
-       <a href="search/saved/add?term={{$q}}&amp;return_url={{$return_url}}" class="btn btn-sm btn-main pull-right" id="search-save" title="{{$save_label}}" aria-label="{{$save_label}}" value="{{$save_label}}" data-toggle="tooltip">
+       <a href="search/saved/add?term={{$q}}&amp;return_url={{$return_url}}" class="btn btn-sm btn-primary pull-right" id="search-save" title="{{$save_label}}" aria-label="{{$save_label}}" value="{{$save_label}}" data-toggle="tooltip">
        {{if $mode == "tag"}}
                <i class="fa fa-plus fa-2x" aria-hidden="true"></i>
        {{else}}