From 1a2b0b25655c85c3d4fad4b4f768d56d466d4282 Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Sat, 3 Nov 2018 13:16:21 -0400 Subject: [PATCH 1/4] Implement xml functions implement functions moved to xml class --- blogger/blogger.php | 7 ++++--- dwpost/dwpost.php | 3 ++- ijpost/ijpost.php | 3 ++- ljpost/ljpost.php | 15 ++++++++------- pumpio/pumpio.php | 3 ++- qcomment/qcomment.php | 14 ++++++++------ wppost/wppost.php | 7 ++++--- 7 files changed, 30 insertions(+), 22 deletions(-) diff --git a/blogger/blogger.php b/blogger/blogger.php index bf4c7eac..ee79032f 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -13,6 +13,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\Network; +use Friendica\Util\XML; function blogger_install() { @@ -178,14 +179,14 @@ function blogger_send(App $a, array &$b) return; } - $bl_username = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username')); - $bl_password = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_password')); + $bl_username = XML::xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username')); + $bl_password = XML::xmlify(PConfig::get($b['uid'], 'blogger', 'bl_password')); $bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog'); if ($bl_username && $bl_password && $bl_blog) { $title = '' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . ''; $post = $title . BBCode::convert($b['body']); - $post = xmlify($post); + $post = XML::xmlify($post); $xml = <<< EOT diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index a75fb878..eec1ea78 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -17,6 +17,7 @@ use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; +use Friendica\Util\XML; function dwpost_install() { @@ -189,7 +190,7 @@ function dwpost_send(App $a, array &$b) if ($dw_username && $dw_password && $dw_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = xmlify($post); + $post = XML::xmlify($post); $tags = dwpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index a5f98f45..f9242a18 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -15,6 +15,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; +use Friendica\Util\XML; function ijpost_install() { @@ -185,7 +186,7 @@ function ijpost_send(&$a, &$b) if ($ij_username && $ij_password && $ij_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = xmlify($post); + $post = XML::xmlify($post); $tags = ijpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index c7857000..47eab5dc 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -15,6 +15,7 @@ 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'); @@ -169,20 +170,20 @@ function ljpost_send(&$a,&$b) { 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::xmlify(PConfig::get($b['uid'],'ljpost','lj_username')); + $lj_password = XML::xmlify(PConfig::get($b['uid'],'ljpost','lj_password')); + $lj_journal = XML::xmlify(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::xmlify(PConfig::get($b['uid'],'ljpost','lj_blog')); if(! strlen($lj_blog)) - $lj_blog = xmlify('http://www.livejournal.com/interface/xmlrpc'); + $lj_blog = XML::xmlify('http://www.livejournal.com/interface/xmlrpc'); if($lj_username && $lj_password && $lj_blog) { - $title = xmlify($b['title']); + $title = XML::xmlify($b['title']); $post = BBCode::convert($b['body']); - $post = xmlify($post); + $post = XML::xmlify($post); $tags = ljpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 0b7b7fac..383ed0b6 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -25,6 +25,7 @@ use Friendica\Model\Queue; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; +use Friendica\Util\XML; require 'addon/pumpio/oauth/http.php'; require 'addon/pumpio/oauth/oauth_client.php'; @@ -981,7 +982,7 @@ function pumpio_dolike(App $a, $uid, $self, $post, $own_id, $threadcompletion = $likedata['body'] = L10n::t('%1$s likes %2$s\'s %3$s', $author, $objauthor, $plink); $likedata['object'] = '' . ACTIVITY_OBJ_NOTE . '1' . - '' . $orig_post['uri'] . '' . xmlify('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; + '' . $orig_post['uri'] . '' . XML::xmlify('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; $ret = Item::insert($likedata); diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index 2ce81d99..f1a23266 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -20,6 +20,7 @@ use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Util\XML; function qcomment_install() { Addon::registerHook('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); @@ -50,7 +51,7 @@ function qcomment_addon_settings(&$a, &$s) $s .= '
'; $s .= '
' . L10n::t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.") . '
'; $s .= ''; - $s .= ''; + $s .= ''; $s .= '
'; $s .= '
'; @@ -59,13 +60,14 @@ function qcomment_addon_settings(&$a, &$s) return; } -function qcomment_addon_settings_post(&$a,&$b) { - - if(! local_user()) +function qcomment_addon_settings_post(&$a, &$b) +{ + if (! local_user()) { return; + } - if($_POST['qcomment-submit']) { - PConfig::set(local_user(),'qcomment','words',xmlify($_POST['qcomment-words'])); + if ($_POST['qcomment-submit']) { + PConfig::set(local_user(), 'qcomment', 'words', XML::xmlify($_POST['qcomment-words'])); info(L10n::t('Quick Comment settings saved.') . EOL); } } diff --git a/wppost/wppost.php b/wppost/wppost.php index 107d8c0c..27061978 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -14,6 +14,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Util\Network; +use Friendica\Util\XML; function wppost_install() { Addon::registerHook('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); @@ -216,8 +217,8 @@ function wppost_send(&$a,&$b) { return; } - $wp_username = xmlify(PConfig::get($b['uid'],'wppost','wp_username')); - $wp_password = xmlify(PConfig::get($b['uid'],'wppost','wp_password')); + $wp_username = XML::(PConfig::get($b['uid'], 'wppost', 'wp_username')); + $wp_password = XML::xmlify(PConfig::get($b['uid'], 'wppost',' wp_password')); $wp_blog = PConfig::get($b['uid'],'wppost','wp_blog'); $wp_backlink_text = PConfig::get($b['uid'],'wppost','wp_backlink_text'); if ($wp_backlink_text == '') { @@ -294,7 +295,7 @@ function wppost_send(&$a,&$b) { . $wp_backlink_text . '' . EOL . EOL; } - $post = xmlify($post); + $post = XML::xmlify($post); $xml = <<< EOT From 7f1fda43aea76a01dfaffba565af94cd2eb28ead Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Sun, 4 Nov 2018 08:24:49 -0500 Subject: [PATCH 2/4] Update function calls update function calls to new names --- blogger/blogger.php | 6 +++--- dwpost/dwpost.php | 2 +- ijpost/ijpost.php | 2 +- ljpost/ljpost.php | 14 +++++++------- pumpio/pumpio.php | 2 +- qcomment/qcomment.php | 4 ++-- wppost/wppost.php | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/blogger/blogger.php b/blogger/blogger.php index ee79032f..496a47c8 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -179,14 +179,14 @@ function blogger_send(App $a, array &$b) return; } - $bl_username = XML::xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username')); - $bl_password = XML::xmlify(PConfig::get($b['uid'], 'blogger', 'bl_password')); + $bl_username = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_username')); + $bl_password = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_password')); $bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog'); if ($bl_username && $bl_password && $bl_blog) { $title = '' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . ''; $post = $title . BBCode::convert($b['body']); - $post = XML::xmlify($post); + $post = XML::escape($post); $xml = <<< EOT diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index eec1ea78..28ae2d97 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -190,7 +190,7 @@ function dwpost_send(App $a, array &$b) if ($dw_username && $dw_password && $dw_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = XML::xmlify($post); + $post = XML::escape($post); $tags = dwpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index f9242a18..d2a3071e 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -186,7 +186,7 @@ function ijpost_send(&$a, &$b) if ($ij_username && $ij_password && $ij_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = XML::xmlify($post); + $post = XML::escape($post); $tags = ijpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 47eab5dc..c60af03c 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -170,20 +170,20 @@ function ljpost_send(&$a,&$b) { if($x && strlen($x[0]['timezone'])) $tz = $x[0]['timezone']; - $lj_username = XML::xmlify(PConfig::get($b['uid'],'ljpost','lj_username')); - $lj_password = XML::xmlify(PConfig::get($b['uid'],'ljpost','lj_password')); - $lj_journal = XML::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 = XML::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 = XML::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 = XML::xmlify($b['title']); + $title = XML::escape($b['title']); $post = BBCode::convert($b['body']); - $post = XML::xmlify($post); + $post = XML::escape($post); $tags = ljpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 383ed0b6..6d3fe62d 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -982,7 +982,7 @@ function pumpio_dolike(App $a, $uid, $self, $post, $own_id, $threadcompletion = $likedata['body'] = L10n::t('%1$s likes %2$s\'s %3$s', $author, $objauthor, $plink); $likedata['object'] = '' . ACTIVITY_OBJ_NOTE . '1' . - '' . $orig_post['uri'] . '' . XML::xmlify('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; + '' . $orig_post['uri'] . '' . XML::escape('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; $ret = Item::insert($likedata); diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index f1a23266..16c5a44c 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -51,7 +51,7 @@ function qcomment_addon_settings(&$a, &$s) $s .= '
'; $s .= '
' . L10n::t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.") . '
'; $s .= ''; - $s .= ''; + $s .= ''; $s .= '
'; $s .= '
'; @@ -67,7 +67,7 @@ function qcomment_addon_settings_post(&$a, &$b) } if ($_POST['qcomment-submit']) { - PConfig::set(local_user(), 'qcomment', 'words', XML::xmlify($_POST['qcomment-words'])); + PConfig::set(local_user(), 'qcomment', 'words', XML::escape($_POST['qcomment-words'])); info(L10n::t('Quick Comment settings saved.') . EOL); } } diff --git a/wppost/wppost.php b/wppost/wppost.php index 27061978..47c30a59 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -218,7 +218,7 @@ function wppost_send(&$a,&$b) { } $wp_username = XML::(PConfig::get($b['uid'], 'wppost', 'wp_username')); - $wp_password = XML::xmlify(PConfig::get($b['uid'], 'wppost',' wp_password')); + $wp_password = XML::escape(PConfig::get($b['uid'], 'wppost',' wp_password')); $wp_blog = PConfig::get($b['uid'],'wppost','wp_blog'); $wp_backlink_text = PConfig::get($b['uid'],'wppost','wp_backlink_text'); if ($wp_backlink_text == '') { @@ -295,7 +295,7 @@ function wppost_send(&$a,&$b) { . $wp_backlink_text . '' . EOL . EOL; } - $post = XML::xmlify($post); + $post = XML::escape($post); $xml = <<< EOT From b8df74beca283afbdba2da9d8ef7fa1f10e8e4dd Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Mon, 5 Nov 2018 07:47:04 -0500 Subject: [PATCH 3/4] update function calls update function calls to new class --- blogger/blogger.php | 8 ++++---- dwpost/dwpost.php | 4 ++-- ijpost/ijpost.php | 4 ++-- ljpost/ljpost.php | 16 ++++++++-------- pumpio/pumpio.php | 4 ++-- qcomment/qcomment.php | 6 +++--- wppost/wppost.php | 8 ++++---- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/blogger/blogger.php b/blogger/blogger.php index 496a47c8..8d8051b0 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -13,7 +13,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\Network; -use Friendica\Util\XML; +use Friendica\Util\Strings; function blogger_install() { @@ -179,14 +179,14 @@ function blogger_send(App $a, array &$b) return; } - $bl_username = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_username')); - $bl_password = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_password')); + $bl_username = Strings::escape(PConfig::get($b['uid'], 'blogger', 'bl_username')); + $bl_password = Strings::escape(PConfig::get($b['uid'], 'blogger', 'bl_password')); $bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog'); if ($bl_username && $bl_password && $bl_blog) { $title = '' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . ''; $post = $title . BBCode::convert($b['body']); - $post = XML::escape($post); + $post = Strings::escape($post); $xml = <<< EOT diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 28ae2d97..b0bb7264 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -17,7 +17,7 @@ use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\XML; +use Friendica\Util\Strings; function dwpost_install() { @@ -190,7 +190,7 @@ function dwpost_send(App $a, array &$b) if ($dw_username && $dw_password && $dw_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = XML::escape($post); + $post = Strings::escape($post); $tags = dwpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index d2a3071e..1203d2f4 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -15,7 +15,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\XML; +use Friendica\Util\Strings; function ijpost_install() { @@ -186,7 +186,7 @@ function ijpost_send(&$a, &$b) if ($ij_username && $ij_password && $ij_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = XML::escape($post); + $post = Strings::escape($post); $tags = ijpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index c60af03c..5c30e09d 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -15,7 +15,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\XML; +use Friendica\Util\Strings; function ljpost_install() { Addon::registerHook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); @@ -170,20 +170,20 @@ function ljpost_send(&$a,&$b) { if($x && strlen($x[0]['timezone'])) $tz = $x[0]['timezone']; - $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')); + $lj_username = Strings::escape(PConfig::get($b['uid'],'ljpost','lj_username')); + $lj_password = Strings::escape(PConfig::get($b['uid'],'ljpost','lj_password')); + $lj_journal = Strings::escape(PConfig::get($b['uid'],'ljpost','lj_journal')); // if(! $lj_journal) // $lj_journal = $lj_username; - $lj_blog = XML::escape(PConfig::get($b['uid'],'ljpost','lj_blog')); + $lj_blog = Strings::escape(PConfig::get($b['uid'],'ljpost','lj_blog')); if(! strlen($lj_blog)) - $lj_blog = XML::escape('http://www.livejournal.com/interface/xmlrpc'); + $lj_blog = Strings::escape('http://www.livejournal.com/interface/xmlrpc'); if($lj_username && $lj_password && $lj_blog) { - $title = XML::escape($b['title']); + $title = Strings::escape($b['title']); $post = BBCode::convert($b['body']); - $post = XML::escape($post); + $post = Strings::escape($post); $tags = ljpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 6d3fe62d..7aa094c9 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -25,7 +25,7 @@ use Friendica\Model\Queue; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\XML; +use Friendica\Util\Strings; require 'addon/pumpio/oauth/http.php'; require 'addon/pumpio/oauth/oauth_client.php'; @@ -982,7 +982,7 @@ function pumpio_dolike(App $a, $uid, $self, $post, $own_id, $threadcompletion = $likedata['body'] = L10n::t('%1$s likes %2$s\'s %3$s', $author, $objauthor, $plink); $likedata['object'] = '' . ACTIVITY_OBJ_NOTE . '1' . - '' . $orig_post['uri'] . '' . XML::escape('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; + '' . $orig_post['uri'] . '' . Strings::escape('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; $ret = Item::insert($likedata); diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index 16c5a44c..5089c27d 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -20,7 +20,7 @@ use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Util\XML; +use Friendica\Util\Strings; function qcomment_install() { Addon::registerHook('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); @@ -51,7 +51,7 @@ function qcomment_addon_settings(&$a, &$s) $s .= '
'; $s .= '
' . L10n::t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.") . '
'; $s .= ''; - $s .= ''; + $s .= ''; $s .= '
'; $s .= '
'; @@ -67,7 +67,7 @@ function qcomment_addon_settings_post(&$a, &$b) } if ($_POST['qcomment-submit']) { - PConfig::set(local_user(), 'qcomment', 'words', XML::escape($_POST['qcomment-words'])); + PConfig::set(local_user(), 'qcomment', 'words', Strings::escape($_POST['qcomment-words'])); info(L10n::t('Quick Comment settings saved.') . EOL); } } diff --git a/wppost/wppost.php b/wppost/wppost.php index 47c30a59..44a06016 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -14,7 +14,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Util\Network; -use Friendica\Util\XML; +use Friendica\Util\Strings; function wppost_install() { Addon::registerHook('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); @@ -217,8 +217,8 @@ function wppost_send(&$a,&$b) { return; } - $wp_username = XML::(PConfig::get($b['uid'], 'wppost', 'wp_username')); - $wp_password = XML::escape(PConfig::get($b['uid'], 'wppost',' wp_password')); + $wp_username = Strings::escape(PConfig::get($b['uid'], 'wppost', 'wp_username')); + $wp_password = Strings::escape(PConfig::get($b['uid'], 'wppost',' wp_password')); $wp_blog = PConfig::get($b['uid'],'wppost','wp_blog'); $wp_backlink_text = PConfig::get($b['uid'],'wppost','wp_backlink_text'); if ($wp_backlink_text == '') { @@ -295,7 +295,7 @@ function wppost_send(&$a,&$b) { . $wp_backlink_text . '' . EOL . EOL; } - $post = XML::escape($post); + $post = Strings::escape($post); $xml = <<< EOT From 1af505701b5e341dcb57fd2e8b3c41461e84d9c5 Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Mon, 5 Nov 2018 07:47:04 -0500 Subject: [PATCH 4/4] Revert "update function calls" This reverts commit b8df74beca283afbdba2da9d8ef7fa1f10e8e4dd. --- blogger/blogger.php | 8 ++++---- dwpost/dwpost.php | 4 ++-- ijpost/ijpost.php | 4 ++-- ljpost/ljpost.php | 16 ++++++++-------- pumpio/pumpio.php | 4 ++-- qcomment/qcomment.php | 6 +++--- wppost/wppost.php | 8 ++++---- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/blogger/blogger.php b/blogger/blogger.php index 8d8051b0..496a47c8 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -13,7 +13,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\Network; -use Friendica\Util\Strings; +use Friendica\Util\XML; function blogger_install() { @@ -179,14 +179,14 @@ function blogger_send(App $a, array &$b) return; } - $bl_username = Strings::escape(PConfig::get($b['uid'], 'blogger', 'bl_username')); - $bl_password = Strings::escape(PConfig::get($b['uid'], 'blogger', 'bl_password')); + $bl_username = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_username')); + $bl_password = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_password')); $bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog'); if ($bl_username && $bl_password && $bl_blog) { $title = '' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . ''; $post = $title . BBCode::convert($b['body']); - $post = Strings::escape($post); + $post = XML::escape($post); $xml = <<< EOT diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index b0bb7264..28ae2d97 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -17,7 +17,7 @@ use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\Strings; +use Friendica\Util\XML; function dwpost_install() { @@ -190,7 +190,7 @@ function dwpost_send(App $a, array &$b) if ($dw_username && $dw_password && $dw_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = Strings::escape($post); + $post = XML::escape($post); $tags = dwpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 1203d2f4..d2a3071e 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -15,7 +15,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\Strings; +use Friendica\Util\XML; function ijpost_install() { @@ -186,7 +186,7 @@ function ijpost_send(&$a, &$b) if ($ij_username && $ij_password && $ij_blog) { $title = $b['title']; $post = BBCode::convert($b['body']); - $post = Strings::escape($post); + $post = XML::escape($post); $tags = ijpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 5c30e09d..c60af03c 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -15,7 +15,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\Strings; +use Friendica\Util\XML; function ljpost_install() { Addon::registerHook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); @@ -170,20 +170,20 @@ function ljpost_send(&$a,&$b) { if($x && strlen($x[0]['timezone'])) $tz = $x[0]['timezone']; - $lj_username = Strings::escape(PConfig::get($b['uid'],'ljpost','lj_username')); - $lj_password = Strings::escape(PConfig::get($b['uid'],'ljpost','lj_password')); - $lj_journal = Strings::escape(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 = Strings::escape(PConfig::get($b['uid'],'ljpost','lj_blog')); + $lj_blog = XML::escape(PConfig::get($b['uid'],'ljpost','lj_blog')); if(! strlen($lj_blog)) - $lj_blog = Strings::escape('http://www.livejournal.com/interface/xmlrpc'); + $lj_blog = XML::escape('http://www.livejournal.com/interface/xmlrpc'); if($lj_username && $lj_password && $lj_blog) { - $title = Strings::escape($b['title']); + $title = XML::escape($b['title']); $post = BBCode::convert($b['body']); - $post = Strings::escape($post); + $post = XML::escape($post); $tags = ljpost_get_tags($b['tag']); $date = DateTimeFormat::convert($b['created'], $tz); diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 7aa094c9..6d3fe62d 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -25,7 +25,7 @@ use Friendica\Model\Queue; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\Strings; +use Friendica\Util\XML; require 'addon/pumpio/oauth/http.php'; require 'addon/pumpio/oauth/oauth_client.php'; @@ -982,7 +982,7 @@ function pumpio_dolike(App $a, $uid, $self, $post, $own_id, $threadcompletion = $likedata['body'] = L10n::t('%1$s likes %2$s\'s %3$s', $author, $objauthor, $plink); $likedata['object'] = '' . ACTIVITY_OBJ_NOTE . '1' . - '' . $orig_post['uri'] . '' . Strings::escape('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; + '' . $orig_post['uri'] . '' . XML::escape('') . '' . $orig_post['title'] . '' . $orig_post['body'] . ''; $ret = Item::insert($likedata); diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index 5089c27d..16c5a44c 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -20,7 +20,7 @@ use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Util\Strings; +use Friendica\Util\XML; function qcomment_install() { Addon::registerHook('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); @@ -51,7 +51,7 @@ function qcomment_addon_settings(&$a, &$s) $s .= '
'; $s .= '
' . L10n::t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.") . '
'; $s .= ''; - $s .= ''; + $s .= ''; $s .= '
'; $s .= '
'; @@ -67,7 +67,7 @@ function qcomment_addon_settings_post(&$a, &$b) } if ($_POST['qcomment-submit']) { - PConfig::set(local_user(), 'qcomment', 'words', Strings::escape($_POST['qcomment-words'])); + PConfig::set(local_user(), 'qcomment', 'words', XML::escape($_POST['qcomment-words'])); info(L10n::t('Quick Comment settings saved.') . EOL); } } diff --git a/wppost/wppost.php b/wppost/wppost.php index 44a06016..47c30a59 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -14,7 +14,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Util\Network; -use Friendica\Util\Strings; +use Friendica\Util\XML; function wppost_install() { Addon::registerHook('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); @@ -217,8 +217,8 @@ function wppost_send(&$a,&$b) { return; } - $wp_username = Strings::escape(PConfig::get($b['uid'], 'wppost', 'wp_username')); - $wp_password = Strings::escape(PConfig::get($b['uid'], 'wppost',' wp_password')); + $wp_username = XML::(PConfig::get($b['uid'], 'wppost', 'wp_username')); + $wp_password = XML::escape(PConfig::get($b['uid'], 'wppost',' wp_password')); $wp_blog = PConfig::get($b['uid'],'wppost','wp_blog'); $wp_backlink_text = PConfig::get($b['uid'],'wppost','wp_backlink_text'); if ($wp_backlink_text == '') { @@ -295,7 +295,7 @@ function wppost_send(&$a,&$b) { . $wp_backlink_text . '' . EOL . EOL; } - $post = Strings::escape($post); + $post = XML::escape($post); $xml = <<< EOT