X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Factivityimporter.php;h=c4dd797e6d8076e11767e1fcb9a950b05aca30fa;hb=8c9efff1ace2d5e466691abf038f096eb5dd5f51;hp=4e13419ae7482ccd0aed3eac7ffad9e15e6ca789;hpb=ae62b919401aff7166eb2ee5b8fdee5e627a68bc;p=quix0rs-gnu-social.git diff --git a/lib/activityimporter.php b/lib/activityimporter.php index 4e13419ae7..c4dd797e6d 100644 --- a/lib/activityimporter.php +++ b/lib/activityimporter.php @@ -109,7 +109,7 @@ class ActivityImporter extends QueueHandler // XXX: don't do this for untrusted input! - Subscription::start($otherProfile, $profile); + Subscription::ensureStart($otherProfile, $profile); } else if (empty($activity->actor) || $activity->actor->id == $author->id) { @@ -123,7 +123,7 @@ class ActivityImporter extends QueueHandler throw new ClientException(_('Unknown profile.')); } - Subscription::start($profile, $otherProfile); + Subscription::ensureStart($profile, $otherProfile); } else { // TRANS: Client exception thrown when trying to import an event not related to the importing user. throw new Exception(_('This activity seems unrelated to our user.')); @@ -213,7 +213,7 @@ class ActivityImporter extends QueueHandler // Get (safe!) HTML and text versions of the content - $rendered = $this->purify($sourceContent); + $rendered = common_purify($sourceContent); $content = common_strip_html($rendered); $shortened = $user->shortenLinks($content); @@ -338,15 +338,4 @@ class ActivityImporter extends QueueHandler return array($groups, $replies); } - - - function purify($content) - { - require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php'; - - $config = array('safe' => 1, - 'deny_attribute' => 'id,style,on*'); - - return htmLawed($content, $config); - } }