]> git.mxchange.org Git - friendica.git/blobdiff - mod/acl.php
Merge pull request #6340 from MrPetovan/bug/1495-fix-admin-theme-settings
[friendica.git] / mod / acl.php
index 48c45f2934bd3009d3dda04a3cecc1b666fc634e..e91919265b350e51b1ec3808b0b527723390edae 100644 (file)
@@ -6,13 +6,13 @@ use Friendica\App;
 use Friendica\Content\Widget;
 use Friendica\Core\ACL;
 use Friendica\Core\Addon;
+use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Item;
 use Friendica\Util\Proxy as ProxyUtils;
-
-require_once 'include/dba.php';
+use Friendica\Util\Strings;
 
 function acl_content(App $a)
 {
@@ -34,7 +34,7 @@ function acl_content(App $a)
                $search = $_REQUEST['query'];
        }
 
-       logger("Searching for ".$search." - type ".$type." conversation ".$conv_id, LOGGER_DEBUG);
+       Logger::log("Searching for ".$search." - type ".$type." conversation ".$conv_id, Logger::DEBUG);
 
        if ($search != '') {
                $sql_extra = "AND `name` LIKE '%%" . DBA::escape($search) . "%%'";
@@ -125,7 +125,7 @@ function acl_content(App $a)
                        $groups[] = [
                                'type'  => 'g',
                                'photo' => 'images/twopeople.png',
-                               'name'  => htmlentities($g['name']),
+                               'name'  => htmlspecialchars($g['name']),
                                'id'    => intval($g['id']),
                                'uids'  => array_map('intval', explode(',', $g['uids'])),
                                'link'  => '',
@@ -187,7 +187,7 @@ function acl_content(App $a)
                );
        } elseif ($type == 'x') {
                // autocomplete for global contact search (e.g. navbar search)
-               $search = notags(trim($_REQUEST['search']));
+               $search = Strings::escapeTags(trim($_REQUEST['search']));
                $mode = $_REQUEST['smode'];
 
                $r = ACL::contactAutocomplete($search, $mode);
@@ -196,7 +196,7 @@ function acl_content(App $a)
                foreach ($r as $g) {
                        $contacts[] = [
                                'photo'   => ProxyUtils::proxifyUrl($g['photo'], false, ProxyUtils::SIZE_MICRO),
-                               'name'    => $g['name'],
+                               'name'    => htmlspecialchars($g['name']),
                                'nick'    => defaults($g, 'addr', $g['url']),
                                'network' => $g['network'],
                                'link'    => $g['url'],
@@ -218,7 +218,7 @@ function acl_content(App $a)
                        $entry = [
                                'type'    => 'c',
                                'photo'   => ProxyUtils::proxifyUrl($g['micro'], false, ProxyUtils::SIZE_MICRO),
-                               'name'    => htmlentities($g['name']),
+                               'name'    => htmlspecialchars($g['name']),
                                'id'      => intval($g['id']),
                                'network' => $g['network'],
                                'link'    => $g['url'],
@@ -279,7 +279,7 @@ function acl_content(App $a)
                                $unknown_contacts[] = [
                                        'type'    => 'c',
                                        'photo'   => ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO),
-                                       'name'    => htmlentities($contact['name']),
+                                       'name'    => htmlspecialchars($contact['name']),
                                        'id'      => intval($contact['cid']),
                                        'network' => $contact['network'],
                                        'link'    => $contact['url'],