1
0
Fork 0

Update function calls

update function calls to new class
This commit is contained in:
Adam Magness 2018-11-05 07:40:18 -05:00
commit 748fb8b946
16 changed files with 114 additions and 110 deletions

View file

@ -33,6 +33,7 @@ use Friendica\Protocol\ActivityPub;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\Strings;
use Friendica\Util\XML;
require_once 'include/enotify.php';
@ -256,7 +257,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$xml = XML::parseString($res);
$status = (int) $xml->status;
$message = XML::unescape($xml->message); // human readable text of what may have gone wrong.
$message = Strings::unescape($xml->message); // human readable text of what may have gone wrong.
switch ($status) {
case 0:
info(L10n::t("Confirmation completed successfully.") . EOL);

View file

@ -8,7 +8,7 @@ use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Renderer;
use Friendica\Model\FileTag;
use Friendica\Util\XML;
use Friendica\Util\Strings;
require_once 'include/items.php';
@ -18,7 +18,7 @@ function filer_content(App $a)
killme();
}
$term = XML::unescape(trim(defaults($_GET, 'term', '')));
$term = Strings::unescape(trim(defaults($_GET, 'term', '')));
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
Logger::log('filer: tag ' . $term . ' item ' . $item_id);

View file

@ -4,7 +4,7 @@ use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Model\FileTag;
use Friendica\Util\XML;
use Friendica\Util\Strings;
function filerm_content(App $a)
{
@ -13,8 +13,8 @@ function filerm_content(App $a)
killme();
}
$term = XML::unescape(trim($_GET['term']));
$cat = XML::unescape(trim($_GET['cat']));
$term = Strings::unescape(trim($_GET['term']));
$cat = Strings::unescape(trim($_GET['cat']));
$category = (($cat) ? true : false);

View file

@ -29,8 +29,8 @@ use Friendica\Protocol\DFRN;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Map;
use Friendica\Util\Security;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
use Friendica\Util\XML;
require_once 'include/items.php';
@ -683,15 +683,15 @@ function photos_post(App $a)
$arr['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
$arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
$arr['object'] .= '<link>' . Strings::escape('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
if ($tagged[3]) {
$arr['object'] .= XML::escape('<link rel="photo" type="'.$p[0]['type'].'" href="' . $tagged[3]['photo'] . '" />' . "\n");
$arr['object'] .= Strings::escape('<link rel="photo" type="'.$p[0]['type'].'" href="' . $tagged[3]['photo'] . '" />' . "\n");
}
$arr['object'] .= '</link></object>' . "\n";
$arr['target'] = '<target><type>' . ACTIVITY_OBJ_IMAGE . '</type><title>' . $p[0]['desc'] . '</title><id>'
. System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '</id>';
$arr['target'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
$arr['target'] .= '<link>' . Strings::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
$item_id = Item::insert($arr);
}

View file

@ -15,7 +15,7 @@ use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Protocol\PortableContact;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\XML;
use Friendica\Util\Strings;
function poco_init(App $a) {
$system_mode = false;
@ -376,7 +376,7 @@ function poco_init(App $a) {
if ($format === 'xml') {
header('Content-type: text/xml');
echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret]));
echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), Strings::arrayEscape(['$response' => $ret]));
killme();
}
if ($format === 'json') {

View file

@ -22,7 +22,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Item;
use Friendica\Util\XML;
use Friendica\Util\Strings;
require_once 'include/items.php';
@ -125,9 +125,9 @@ function poke_init(App $a)
$arr['body'] = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . L10n::t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]';
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $target['name'] . '</title><id>' . $target['url'] . '</id>';
$arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
$arr['object'] .= '<link>' . Strings::escape('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
$arr['object'] .= XML::escape('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n");
$arr['object'] .= Strings::escape('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n";
$item_id = Item::insert($arr);

View file

@ -24,7 +24,7 @@ use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\DFRN;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Security;
use Friendica\Util\XML;
use Friendica\Util\Strings;
function profile_init(App $a)
{
@ -210,7 +210,7 @@ function profile_content(App $a, $update = 0)
$commvisitor = $commpage && $remote_contact;
$a->page['aside'] .= posted_date_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], $a->profile['profile_uid'], true);
$a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (!empty($category) ? XML::escape($category) : ''));
$a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (!empty($category) ? Strings::escape($category) : ''));
$a->page['aside'] .= Widget::tagCloud();
if (Security::canWriteToUserWall($a->profile['profile_uid'])) {

View file

@ -10,7 +10,7 @@ use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Item;
use Friendica\Util\Security;
use Friendica\Util\XML;
use Friendica\Util\Strings;
require_once 'include/items.php';
@ -88,7 +88,7 @@ function subthread_content(App $a) {
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$link = XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
$link = Strings::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
$body = $item['body'];
$obj = <<< EOT

View file

@ -10,7 +10,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Item;
use Friendica\Util\XML;
use Friendica\Util\Strings;
require_once 'include/items.php';
@ -67,7 +67,7 @@ function tagger_content(App $a) {
}
$uri = Item::newURI($owner_uid);
$xterm = XML::escape($term);
$xterm = Strings::escape($term);
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
@ -77,9 +77,9 @@ function tagger_content(App $a) {
$href = System::baseUrl() . '/display/' . $item['guid'];
}
$link = XML::escape('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n") ;
$link = Strings::escape('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n") ;
$body = XML::escape($item['body']);
$body = Strings::escape($item['body']);
$target = <<< EOT
<target>