]> git.mxchange.org Git - friendica.git/commitdiff
Remove redundant htmlentities/htmlspecialchars
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 25 Dec 2018 16:37:32 +0000 (11:37 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 25 Dec 2018 16:37:57 +0000 (11:37 -0500)
14 files changed:
mod/admin.php
mod/allfriends.php
mod/babel.php
mod/common.php
mod/credits.php
mod/crepair.php
mod/editpost.php
mod/follow.php
mod/message.php
mod/network.php
mod/unfollow.php
mod/wallmessage.php
src/Content/Text/HTML.php
src/Module/Itemsource.php

index 89514397f0da0fea80fe51703b13cf7a41599b8b..eab2e722674439eba8822d2dc0016a30531a7d16 100644 (file)
@@ -1444,9 +1444,7 @@ function admin_page_site(App $a)
                $banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
        }
 
-       $banner = htmlspecialchars($banner);
        $info = Config::get('config', 'info');
-       $info = htmlspecialchars($info);
 
        // Automatically create temporary paths
        get_temppath();
index b233a46182050ddc8d37b3d266950117bb300132..7a39c481db50786353d255bce8e61f1e5491d716 100644 (file)
@@ -81,9 +81,9 @@ function allfriends_content(App $a)
                $entry = [
                        'url'          => $rr['url'],
                        'itemurl'      => defaults($contact_details, 'addr', $rr['url']),
-                       'name'         => htmlentities($contact_details['name']),
+                       'name'         => $contact_details['name'],
                        'thumb'        => ProxyUtils::proxifyUrl($contact_details['thumb'], false, ProxyUtils::SIZE_THUMB),
-                       'img_hover'    => htmlentities($contact_details['name']),
+                       'img_hover'    => $contact_details['name'],
                        'details'      => $contact_details['location'],
                        'tags'         => $contact_details['keywords'],
                        'about'        => $contact_details['about'],
@@ -100,9 +100,7 @@ function allfriends_content(App $a)
        $tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
 
        $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
-
        $o .= Renderer::replaceMacros($tpl, [
-               //'$title' => L10n::t('Friends of %s', htmlentities($c[0]['name'])),
                '$tab_str' => $tab_str,
                '$contacts' => $entries,
                '$paginate' => $pager->renderFull($total),
index b9846e4fb433a16867f7d6afd20bedff2cbd0aac..64c9557767d278d7a6122019dbd6016f4c3087d0 100644 (file)
@@ -142,7 +142,7 @@ function babel_content()
 
        $tpl = Renderer::getMarkupTemplate('babel.tpl');
        $o = Renderer::replaceMacros($tpl, [
-               '$text'          => ['text', L10n::t('Source text'), htmlentities(defaults($_REQUEST, 'text', '')), ''],
+               '$text'          => ['text', L10n::t('Source text'), defaults($_REQUEST, 'text', ''), ''],
                '$type_bbcode'   => ['type', L10n::t('BBCode'), 'bbcode', '', defaults($_REQUEST, 'type', 'bbcode') == 'bbcode'],
                '$type_markdown' => ['type', L10n::t('Markdown'), 'markdown', '', defaults($_REQUEST, 'type', 'bbcode') == 'markdown'],
                '$type_html'     => ['type', L10n::t('HTML'), 'html', '', defaults($_REQUEST, 'type', 'bbcode') == 'html'],
index c88d6ee77c2594aa57ed1707b30fc26160652a06..c93edf3b3097666b60dc4e8770f70f10dbef0809 100644 (file)
@@ -50,7 +50,7 @@ function common_content(App $a)
 
                if (DBA::isResult($contact)) {
                        $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate("vcard-widget.tpl"), [
-                               '$name'  => htmlentities($contact['name']),
+                               '$name'  => $contact['name'],
                                '$photo' => $contact['photo'],
                                'url'    => 'contact/' . $cid
                        ]);
@@ -123,7 +123,7 @@ function common_content(App $a)
                        'itemurl'      => defaults($contact_details, 'addr', $common_friend['url']),
                        'name'         => $contact_details['name'],
                        'thumb'        => ProxyUtils::proxifyUrl($contact_details['thumb'], false, ProxyUtils::SIZE_THUMB),
-                       'img_hover'    => htmlentities($contact_details['name']),
+                       'img_hover'    => $contact_details['name'],
                        'details'      => $contact_details['location'],
                        'tags'         => $contact_details['keywords'],
                        'about'        => $contact_details['about'],
index c53c86b8b9882b3b1913cb2db2ab651a8069d7f1..f397bdca70f5f00898ae80d8cf3bf7b86f84f3e3 100644 (file)
@@ -13,7 +13,7 @@ function credits_content()
 {
        /* fill the page with credits */
        $credits_string = file_get_contents('util/credits.txt');
-       $names = explode("\n", htmlspecialchars($credits_string));
+       $names = explode("\n", $credits_string);
        $tpl = Renderer::getMarkupTemplate('credits.tpl');
        return Renderer::replaceMacros($tpl, [
                '$title'  => L10n::t('Credits'),
index 8623d3c4ac122d5b1695c1de3065024af39c89ff..91b22dbc92b1c9085ce4709b361d4fa67cf009a7 100644 (file)
@@ -158,8 +158,8 @@ function crepair_content(App $a)
                        $remote_self_options
                ],
 
-               '$name'         => ['name', L10n::t('Name') , htmlentities($contact['name'])],
-               '$nick'         => ['nick', L10n::t('Account Nickname'), htmlentities($contact['nick'])],
+               '$name'         => ['name', L10n::t('Name') , $contact['name']],
+               '$nick'         => ['nick', L10n::t('Account Nickname'), $contact['nick']],
                '$attag'        => ['attag', L10n::t('@Tagname - overrides Name/Nickname'), $contact['attag']],
                '$url'          => ['url', L10n::t('Account URL'), $contact['url']],
                '$request'      => ['request', L10n::t('Friend Request URL'), $contact['request']],
index b518588a591a46042cef3b7978295a42d9f58227..1e53285830dd5d2d272cc8182076bd878a704999 100644 (file)
@@ -6,6 +6,7 @@ use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
+use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
@@ -54,8 +55,6 @@ function editpost_content(App $a)
                '$nickname' => $a->user['nickname']
        ]);
 
-       $tpl = Renderer::getMarkupTemplate("jot.tpl");
-
        if (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) {
                $lockstate = 'lock';
        } else {
@@ -84,9 +83,9 @@ function editpost_content(App $a)
                }
        }
 
-       Addon::callHooks('jot_tool', $jotplugins);
-       //Addon::callHooks('jot_networks', $jotnets);
+       Hook::callAll('jot_tool', $jotplugins);
 
+       $tpl = Renderer::getMarkupTemplate("jot.tpl");
        $o .= Renderer::replaceMacros($tpl, [
                '$is_edit' => true,
                '$return_path' => '/display/' . $item['guid'],
@@ -119,7 +118,7 @@ function editpost_content(App $a)
                '$emailcc' => L10n::t('CC: email addresses'),
                '$public' => L10n::t('Public post'),
                '$jotnets' => $jotnets,
-               '$title' => htmlspecialchars($item['title']),
+               '$title' => $item['title'],
                '$placeholdertitle' => L10n::t('Set title'),
                '$category' => FileTag::fileToList($item['file'], 'category'),
                '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? L10n::t("Categories \x28comma-separated list\x29") : ''),
index 1ee61ce9e14802448c8a8b87e59a699a18b5ed4c..f8e2539d97e2cf6c9e0f14adb266bcc21dd4d2e4 100644 (file)
@@ -144,11 +144,8 @@ function follow_content(App $a)
                $r[0]['about'] = '';
        }
 
-       $header = L10n::t('Connect/Follow');
-
        $o = Renderer::replaceMacros($tpl, [
-               '$header'        => htmlentities($header),
-               //'$photo'         => ProxyUtils::proxifyUrl($ret['photo'], false, ProxyUtils::SIZE_SMALL),
+               '$header'        => L10n::t('Connect/Follow'),
                '$desc'          => '',
                '$pls_answer'    => L10n::t('Please answer the following:'),
                '$does_know_you' => ['knowyou', L10n::t('Does %s know you?', $ret['name']), false, '', [L10n::t('No'), L10n::t('Yes')]],
@@ -170,13 +167,6 @@ function follow_content(App $a)
                '$url_label'     => L10n::t('Profile URL'),
                '$myaddr'        => $myaddr,
                '$request'       => $request,
-               /*
-                * @TODO commented out?
-               '$location'      => Friendica\Content\Text\BBCode::::convert($r[0]['location']),
-               '$location_label'=> L10n::t('Location:'),
-               '$about'         => Friendica\Content\Text\BBCode::::convert($r[0]['about'], false, false),
-               '$about_label'   => L10n::t('About:'),
-               */
                '$keywords'      => $r[0]['keywords'],
                '$keywords_label'=> L10n::t('Tags:')
        ]);
index af194879902e8fd898682b75237ebe901aabd821..d0993698b7507f9905a11dd90934719e2fd2455d 100644 (file)
@@ -247,22 +247,22 @@ function message_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('prv_message.tpl');
                $o .= Renderer::replaceMacros($tpl, [
-                       '$header' => L10n::t('Send Private Message'),
-                       '$to' => L10n::t('To:'),
+                       '$header'     => L10n::t('Send Private Message'),
+                       '$to'         => L10n::t('To:'),
                        '$showinputs' => 'true',
-                       '$prefill' => $prefill,
-                       '$preid' => $preid,
-                       '$subject' => L10n::t('Subject:'),
-                       '$subjtxt' => !empty($_REQUEST['subject']) ? strip_tags($_REQUEST['subject']) : '',
-                       '$text' => !empty($_REQUEST['body']) ? Strings::escapeHtml(htmlspecialchars($_REQUEST['body'])) : '',
-                       '$readonly' => '',
-                       '$yourmessage' => L10n::t('Your message:'),
-                       '$select' => $select,
-                       '$parent' => '',
-                       '$upload' => L10n::t('Upload photo'),
-                       '$insert' => L10n::t('Insert web link'),
-                       '$wait' => L10n::t('Please wait'),
-                       '$submit' => L10n::t('Submit')
+                       '$prefill'    => $prefill,
+                       '$preid'      => $preid,
+                       '$subject'    => L10n::t('Subject:'),
+                       '$subjtxt'    => defaults($_REQUEST, 'subject', ''),
+                       '$text'       => defaults($_REQUEST, 'body', ''),
+                       '$readonly'   => '',
+                       '$yourmessage'=> L10n::t('Your message:'),
+                       '$select'     => $select,
+                       '$parent'     => '',
+                       '$upload'     => L10n::t('Upload photo'),
+                       '$insert'     => L10n::t('Insert web link'),
+                       '$wait'       => L10n::t('Please wait'),
+                       '$submit'     => L10n::t('Submit')
                ]);
                return $o;
        }
index 46861e39434a6058c2e95c14055a0d381b161822..6a4413b54e88d355ca5977d223f934a6b141cd03 100644 (file)
@@ -667,7 +667,7 @@ function networkThreadedView(App $a, $update, $parent)
 
                        $entries[0] = [
                                'id' => 'network',
-                               'name' => htmlentities($contact['name']),
+                               'name' => $contact['name'],
                                'itemurl' => defaults($contact, 'addr', $contact['nurl']),
                                'thumb' => ProxyUtils::proxifyUrl($contact['thumb'], false, ProxyUtils::SIZE_THUMB),
                                'details' => $contact['location'],
index 433a4782ff872c15b1fa0afabaffe1f09b155e38..a66c88aefd2d9dcfe993c4d81cef222f11efcbd7 100644 (file)
@@ -114,10 +114,8 @@ function unfollow_content(App $a)
        // Makes the connection request for friendica contacts easier
        $_SESSION['fastlane'] = $contact['url'];
 
-       $header = L10n::t('Disconnect/Unfollow');
-
        $o = Renderer::replaceMacros($tpl, [
-               '$header'        => htmlentities($header),
+               '$header'        => L10n::t('Disconnect/Unfollow'),
                '$desc'          => '',
                '$pls_answer'    => '',
                '$does_know_you' => '',
index d93104644ed6462426b2dbb3afec7517f35b76d3..780230b8c700e479dfc28744b41877ddb9b88f40 100644 (file)
@@ -125,20 +125,20 @@ function wallmessage_content(App $a) {
 
        $tpl = Renderer::getMarkupTemplate('wallmessage.tpl');
        $o = Renderer::replaceMacros($tpl, [
-               '$header' => L10n::t('Send Private Message'),
-               '$subheader' => L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
-               '$to' => L10n::t('To:'),
-               '$subject' => L10n::t('Subject:'),
-               '$recipname' => $user['username'],
-               '$nickname' => $user['nickname'],
-               '$subjtxt' => (!empty($_REQUEST['subject']) ? strip_tags($_REQUEST['subject']) : ''),
-               '$text' => (!empty($_REQUEST['body']) ? Strings::escapeHtml(htmlspecialchars($_REQUEST['body'])) : ''),
-               '$readonly' => '',
-               '$yourmessage' => L10n::t('Your message:'),
-               '$parent' => '',
-               '$upload' => L10n::t('Upload photo'),
-               '$insert' => L10n::t('Insert web link'),
-               '$wait' => L10n::t('Please wait')
+               '$header'     => L10n::t('Send Private Message'),
+               '$subheader'  => L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
+               '$to'         => L10n::t('To:'),
+               '$subject'    => L10n::t('Subject:'),
+               '$recipname'  => $user['username'],
+               '$nickname'   => $user['nickname'],
+               '$subjtxt'    => defaults($_REQUEST, 'subject', ''),
+               '$text'       => defaults($_REQUEST, 'body', ''),
+               '$readonly'   => '',
+               '$yourmessage'=> L10n::t('Your message:'),
+               '$parent'     => '',
+               '$upload'     => L10n::t('Upload photo'),
+               '$insert'     => L10n::t('Insert web link'),
+               '$wait'       => L10n::t('Please wait')
        ]);
 
        return $o;
index e452e68353e5f8db7af39068e94882075157c5a5..276094a8f9e9d691c0eb743b0cf74bc69fa4bd24 100644 (file)
@@ -961,7 +961,7 @@ class HTML
                $save_label = $mode === 'text' ? L10n::t('Save') : L10n::t('Follow');
 
                $values = [
-                               '$s' => htmlspecialchars($s),
+                               '$s' => $s,
                                '$id' => $id,
                                '$action_url' => $url,
                                '$search_label' => L10n::t('Search'),
index 2da679eeefffd725cc3cb680d71bf37badd474e5..4d85ef15ceff2a408a79087e92234daf4f349ae5 100644 (file)
@@ -25,12 +25,12 @@ class Itemsource extends \Friendica\BaseModule
                        $conversation = Model\Conversation::getByItemUri($item['uri']);
 
                        $item_uri = $item['uri'];
-                       $source = htmlspecialchars($conversation['source']);
+                       $source = $conversation['source'];
                }
 
                $tpl = Renderer::getMarkupTemplate('debug/itemsource.tpl');
                $o = Renderer::replaceMacros($tpl, [
-                       '$guid'          => ['guid', L10n::t('Item Guid'), htmlentities(defaults($_REQUEST, 'guid', '')), ''],
+                       '$guid'          => ['guid', L10n::t('Item Guid'), defaults($_REQUEST, 'guid', ''), ''],
                        '$source'        => $source,
                        '$item_uri'      => $item_uri
                ]);