use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Content\Widget;
+use Friendica\Content\Text\HTML;
use Friendica\Core\ACL;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Module\Login;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Strings;
require_once 'include/conversation.php';
require_once 'include/items.php';
Hook::add('head', __FILE__, 'network_infinite_scroll_head');
- $search = (x($_GET, 'search') ? escape_tags($_GET['search']) : '');
+ $search = (x($_GET, 'search') ? Strings::escapeHtml($_GET['search']) : '');
if (($search != '') && !empty($_GET['submit'])) {
$a->internalRedirect('search?search=' . urlencode($search));
];
}
- $tpl = get_markup_template('saved_searches_aside.tpl');
+ $tpl = Renderer::getMarkupTemplate('saved_searches_aside.tpl');
$o = Renderer::replaceMacros($tpl, [
'$title' => L10n::t('Saved Searches'),
'$add' => L10n::t('add'),
- '$searchbox' => search($search, 'netsearch-box', $srchurl, true),
+ '$searchbox' => HTML::search($search, 'netsearch-box', $srchurl, true),
'$saved' => $saved,
]);
if (!$update) {
if (PConfig::get(local_user(), 'system', 'infinite_scroll')) {
- $o .= scroll_loader();
+ $o .= HTML::scrollLoader();
} else {
$o .= $pager->renderMinimal(count($items));
}
for ($x = 1; $x < $a->argc; $x ++) {
if (is_a_date_arg($a->argv[$x])) {
if ($datequery) {
- $datequery2 = escape_tags($a->argv[$x]);
+ $datequery2 = Strings::escapeHtml($a->argv[$x]);
} else {
- $datequery = escape_tags($a->argv[$x]);
+ $datequery = Strings::escapeHtml($a->argv[$x]);
$_GET['order'] = 'post';
}
} elseif (intval($a->argv[$x])) {
$star = intval(defaults($_GET, 'star' , 0));
$bmark = intval(defaults($_GET, 'bmark', 0));
$conv = intval(defaults($_GET, 'conv' , 0));
- $order = notags(defaults($_GET, 'order', 'comment'));
+ $order = Strings::escapeTags(defaults($_GET, 'order', 'comment'));
$nets = defaults($_GET, 'nets' , '');
if ($cid) {
$sql_post_table .= " INNER JOIN `item` AS `temp1` ON `temp1`.`id` = " . $sql_table . "." . $sql_parent;
$sql_extra3 .= " AND (`thread`.`contact-id` IN ($contact_str) ";
- $sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . protect_sprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))";
+ $sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . Strings::protectSprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))";
} else {
$sql_extra3 .= " AND false ";
info(L10n::t('Group is empty'));
}
- $o = Renderer::replaceMacros(get_markup_template('section_title.tpl'), [
+ $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
'$title' => L10n::t('Group: %s', $group['name'])
]) . $o;
} elseif ($cid) {
$entries[0]['account_type'] = Contact::getAccountType($contact);
- $o = Renderer::replaceMacros(get_markup_template('viewcontact_template.tpl'), [
+ $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('viewcontact_template.tpl'), [
'contacts' => $entries,
'id' => 'network',
]) . $o;
}
if ($datequery) {
- $sql_extra3 .= protect_sprintf(sprintf(" AND $sql_table.created <= '%s' ",
+ $sql_extra3 .= Strings::protectSprintf(sprintf(" AND $sql_table.created <= '%s' ",
DBA::escape(DateTimeFormat::convert($datequery, 'UTC', date_default_timezone_get()))));
}
if ($datequery2) {
- $sql_extra3 .= protect_sprintf(sprintf(" AND $sql_table.created >= '%s' ",
+ $sql_extra3 .= Strings::protectSprintf(sprintf(" AND $sql_table.created >= '%s' ",
DBA::escape(DateTimeFormat::convert($datequery2, 'UTC', date_default_timezone_get()))));
}
foreach ($data as $item) {
// Don't show hash tag posts from blocked or ignored contacts
$condition = ["`nurl` = ? AND `uid` = ? AND (`blocked` OR `readonly`)",
- normalise_link($item['author-link']), local_user()];
+ Strings::normaliseLink($item['author-link']), local_user()];
if (!DBA::exists('contact', $condition)) {
$s[$item['uri']] = $item;
}
$arr = ['tabs' => $tabs];
Addon::callHooks('network_tabs', $arr);
- $tpl = get_markup_template('common_tabs.tpl');
+ $tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs']]);
if (PConfig::get(local_user(), 'system', 'infinite_scroll')
&& defaults($_GET, 'mode', '') != 'minimal'
) {
- $tpl = get_markup_template('infinite_scroll_head.tpl');
+ $tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
$htmlhead .= Renderer::replaceMacros($tpl, [
'$pageno' => $pager->getPage(),
'$reload_uri' => $pager->getBaseQueryString()