use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
+use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
+use Friendica\Util\XML;
function ljpost_install() {
Addon::registerHook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local');
if($x && strlen($x[0]['timezone']))
$tz = $x[0]['timezone'];
- $lj_username = xmlify(PConfig::get($b['uid'],'ljpost','lj_username'));
- $lj_password = xmlify(PConfig::get($b['uid'],'ljpost','lj_password'));
- $lj_journal = xmlify(PConfig::get($b['uid'],'ljpost','lj_journal'));
+ $lj_username = XML::escape(PConfig::get($b['uid'],'ljpost','lj_username'));
+ $lj_password = XML::escape(PConfig::get($b['uid'],'ljpost','lj_password'));
+ $lj_journal = XML::escape(PConfig::get($b['uid'],'ljpost','lj_journal'));
// if(! $lj_journal)
// $lj_journal = $lj_username;
- $lj_blog = xmlify(PConfig::get($b['uid'],'ljpost','lj_blog'));
+ $lj_blog = XML::escape(PConfig::get($b['uid'],'ljpost','lj_blog'));
if(! strlen($lj_blog))
- $lj_blog = xmlify('http://www.livejournal.com/interface/xmlrpc');
+ $lj_blog = XML::escape('http://www.livejournal.com/interface/xmlrpc');
if($lj_username && $lj_password && $lj_blog) {
- $title = xmlify($b['title']);
+ $title = XML::escape($b['title']);
$post = BBCode::convert($b['body']);
- $post = xmlify($post);
+ $post = XML::escape($post);
$tags = ljpost_get_tags($b['tag']);
$date = DateTimeFormat::convert($b['created'], $tz);
EOT;
- logger('ljpost: data: ' . $xml, LOGGER_DATA);
+ Logger::log('ljpost: data: ' . $xml, Logger::DATA);
if ($lj_blog !== 'test') {
$x = Network::post($lj_blog, $xml, ["Content-Type: text/xml"])->getBody();
}
- logger('posted to livejournal: ' . ($x) ? $x : '', LOGGER_DEBUG);
+ Logger::log('posted to livejournal: ' . ($x) ? $x : '', Logger::DEBUG);
}
}