X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fimporttwitteratom.php;h=2a4cb7fc41f2f0950ac69e5587b30c4e51c048b5;hb=586aaa596e2277a2c4bea9cae476014a2837a41d;hp=a29526f27e1726f57f3679dcdab034fbf4350614;hpb=99194e03fa50b61f99164674afc949b4bbefd44a;p=quix0rs-gnu-social.git diff --git a/scripts/importtwitteratom.php b/scripts/importtwitteratom.php old mode 100644 new mode 100755 index a29526f27e..2a4cb7fc41 --- a/scripts/importtwitteratom.php +++ b/scripts/importtwitteratom.php @@ -34,7 +34,6 @@ import an Atom feed from Twitter as notices by a user END_OF_IMPORTTWITTERATOM_HELP; require_once INSTALLDIR.'/scripts/commandline.inc'; -require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php'; function getAtomFeedDocument() { @@ -82,12 +81,7 @@ function importActivityStream($user, $doc) if (!have_option('q', 'quiet')) { print $activity->content . "\n"; } - $html = getTweetHtml($object->link); - - $config = array('safe' => 1, - 'deny_attribute' => 'class,rel,id,style,on*'); - - $html = htmLawed($html, $config); + $html = common_purify(getTweetHtml($object->link)); $content = html_entity_decode(strip_tags($html), ENT_QUOTES, 'UTF-8'); @@ -108,7 +102,7 @@ function getTweetHtml($url) try { $client = new HTTPClient(); $response = $client->get($url); - } catch (HTTP_Request2_Exception $e) { + } catch (Exception $e) { print "ERROR: HTTP response " . $e->getMessage() . "\n"; return false; }