]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/activityimporter.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / lib / activityimporter.php
index 2cf950183005a3477352488f68e965cb94200626..51ea8ddf6bdca3d3871e03f103ca81a0f9a04cd3 100644 (file)
@@ -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);
@@ -339,15 +339,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);
-    }
 }