aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/pubsubhubbub/pubsubhubbub.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-11-10 10:46:04 +0100
committerGitHub <noreply@github.com>2020-11-10 10:46:04 +0100
commit302662797cb5e8ac6579a99297ceae301f7927a6 (patch)
tree67f493a1cc6d3691742946f1d7e512bffe41e02f /plugins/pubsubhubbub/pubsubhubbub.php
parentc94c32d1a3e86a479cb2582eadc668a5bb476fc6 (diff)
parent2f4df753041088d788d1923692a7d530167a6840 (diff)
downloadShaarli-302662797cb5e8ac6579a99297ceae301f7927a6.tar.gz
Shaarli-302662797cb5e8ac6579a99297ceae301f7927a6.tar.zst
Shaarli-302662797cb5e8ac6579a99297ceae301f7927a6.zip
Merge pull request #1635 from ArthurHoaro/feature/phpcs
Diffstat (limited to 'plugins/pubsubhubbub/pubsubhubbub.php')
-rw-r--r--plugins/pubsubhubbub/pubsubhubbub.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/pubsubhubbub/pubsubhubbub.php b/plugins/pubsubhubbub/pubsubhubbub.php
index 8fe6799c..299b84fb 100644
--- a/plugins/pubsubhubbub/pubsubhubbub.php
+++ b/plugins/pubsubhubbub/pubsubhubbub.php
@@ -42,7 +42,7 @@ function pubsubhubbub_init($conf)
42function hook_pubsubhubbub_render_feed($data, $conf) 42function hook_pubsubhubbub_render_feed($data, $conf)
43{ 43{
44 $feedType = $data['_PAGE_'] == TemplatePage::FEED_RSS ? FeedBuilder::$FEED_RSS : FeedBuilder::$FEED_ATOM; 44 $feedType = $data['_PAGE_'] == TemplatePage::FEED_RSS ? FeedBuilder::$FEED_RSS : FeedBuilder::$FEED_ATOM;
45 $template = file_get_contents(PluginManager::$PLUGINS_PATH . '/pubsubhubbub/hub.'. $feedType .'.xml'); 45 $template = file_get_contents(PluginManager::$PLUGINS_PATH . '/pubsubhubbub/hub.' . $feedType . '.xml');
46 $data['feed_plugins_header'][] = sprintf($template, $conf->get('plugins.PUBSUBHUB_URL')); 46 $data['feed_plugins_header'][] = sprintf($template, $conf->get('plugins.PUBSUBHUB_URL'));
47 47
48 return $data; 48 return $data;
@@ -59,10 +59,10 @@ function hook_pubsubhubbub_render_feed($data, $conf)
59 */ 59 */
60function hook_pubsubhubbub_save_link($data, $conf) 60function hook_pubsubhubbub_save_link($data, $conf)
61{ 61{
62 $feeds = array( 62 $feeds = [
63 index_url($_SERVER) .'feed/atom', 63 index_url($_SERVER) . 'feed/atom',
64 index_url($_SERVER) .'feed/rss', 64 index_url($_SERVER) . 'feed/rss',
65 ); 65 ];
66 66
67 $httpPost = function_exists('curl_version') ? false : 'nocurl_http_post'; 67 $httpPost = function_exists('curl_version') ? false : 'nocurl_http_post';
68 try { 68 try {
@@ -87,11 +87,11 @@ function hook_pubsubhubbub_save_link($data, $conf)
87 */ 87 */
88function nocurl_http_post($url, $postString) 88function nocurl_http_post($url, $postString)
89{ 89{
90 $params = array('http' => array( 90 $params = ['http' => [
91 'method' => 'POST', 91 'method' => 'POST',
92 'content' => $postString, 92 'content' => $postString,
93 'user_agent' => 'PubSubHubbub-Publisher-PHP/1.0', 93 'user_agent' => 'PubSubHubbub-Publisher-PHP/1.0',
94 )); 94 ]];
95 95
96 $context = stream_context_create($params); 96 $context = stream_context_create($params);
97 $fp = @fopen($url, 'rb', false, $context); 97 $fp = @fopen($url, 'rb', false, $context);