From: VirtualTam Date: Fri, 12 Oct 2018 22:22:45 +0000 (+0200) Subject: lint: apply phpcbf to plugins/ X-Git-Tag: v0.10.3~2^2~2^2~3 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=a0ab3c3f68ed3bca7d218e6e5847820b82b086ca;p=github%2Fshaarli%2FShaarli.git lint: apply phpcbf to plugins/ Signed-off-by: VirtualTam --- diff --git a/plugins/archiveorg/archiveorg.php b/plugins/archiveorg/archiveorg.php index cda35751..5dcea5a6 100644 --- a/plugins/archiveorg/archiveorg.php +++ b/plugins/archiveorg/archiveorg.php @@ -17,7 +17,7 @@ function hook_archiveorg_render_linklist($data) $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html'); foreach ($data['links'] as &$value) { - if($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) { + if ($value['private'] && preg_match('/^\?[a-zA-Z0-9-_@]{6}($|&|#)/', $value['real_url'])) { continue; } $archive = sprintf($archive_html, $value['url'], t('View on archive.org')); diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index f3a63b6a..bdbc719b 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php @@ -73,7 +73,6 @@ function hook_demo_plugin_render_header($data) { // Only execute when linklist is rendered. if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { - // If loggedin if ($data['_LOGGEDIN_'] === true) { /* @@ -448,8 +447,7 @@ function hook_demo_plugin_render_feed($data) foreach ($data['links'] as &$link) { if ($data['_PAGE_'] == Router::$PAGE_FEED_ATOM) { $link['description'] .= ' - ATOM Feed' ; - } - elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) { + } elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) { $link['description'] .= ' - RSS Feed'; } } diff --git a/plugins/markdown/markdown.php b/plugins/markdown/markdown.php index 08e64dae..8823af91 100644 --- a/plugins/markdown/markdown.php +++ b/plugins/markdown/markdown.php @@ -139,7 +139,6 @@ function hook_markdown_render_includes($data) || $data['_PAGE_'] == Router::$PAGE_DAILY || $data['_PAGE_'] == Router::$PAGE_EDITLINK ) { - $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/markdown/markdown.css'; } @@ -195,8 +194,7 @@ function reverse_text2clickable($description) // Detect and toggle block of code if (!$codeBlockOn) { $codeBlockOn = preg_match('/^```/', $descriptionLine) > 0; - } - elseif (preg_match('/^```/', $descriptionLine) > 0) { + } elseif (preg_match('/^```/', $descriptionLine) > 0) { $codeBlockOn = false; } @@ -302,13 +300,17 @@ function sanitize_html($description) foreach ($escapeTags as $tag) { $description = preg_replace_callback( '#<\s*'. $tag .'[^>]*>(.*]*>)?#is', - function ($match) { return escape($match[0]); }, - $description); + function ($match) { + return escape($match[0]); + }, + $description + ); } $description = preg_replace( '#(<[^>]+\s)on[a-z]*="?[^ "]*"?#is', '$1', - $description); + $description + ); return $description; } @@ -341,7 +343,7 @@ function process_markdown($description, $escape = true, $allowedProtocols = []) ->text($processedDescription); $processedDescription = sanitize_html($processedDescription); - if(!empty($processedDescription)){ + if (!empty($processedDescription)) { $processedDescription = '
'. $processedDescription . '
'; } diff --git a/plugins/pubsubhubbub/pubsubhubbub.php b/plugins/pubsubhubbub/pubsubhubbub.php index 184b588b..9f0342a3 100644 --- a/plugins/pubsubhubbub/pubsubhubbub.php +++ b/plugins/pubsubhubbub/pubsubhubbub.php @@ -6,7 +6,7 @@ * PubSub is a protocol which fasten up RSS fetching: * - Every time a new link is posted, Shaarli notify the hub. * - The hub notify all feed subscribers that a new link has been posted. - * - Subscribers retrieve the new link. + * - Subscribers retrieve the new link. */ use pubsubhubbub\publisher\Publisher; @@ -82,7 +82,8 @@ function hook_pubsubhubbub_save_link($data, $conf) * * @throws Exception An error occurred. */ -function nocurl_http_post($url, $postString) { +function nocurl_http_post($url, $postString) +{ $params = array('http' => array( 'method' => 'POST', 'content' => $postString, diff --git a/plugins/qrcode/qrcode.php b/plugins/qrcode/qrcode.php index 0f96a106..4b59caa0 100644 --- a/plugins/qrcode/qrcode.php +++ b/plugins/qrcode/qrcode.php @@ -17,7 +17,8 @@ function hook_qrcode_render_linklist($data) $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html'); foreach ($data['links'] as &$value) { - $qrcode = sprintf($qrcode_html, + $qrcode = sprintf( + $qrcode_html, urlencode($value['url']), $value['url'], PluginManager::$PLUGINS_PATH diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php index 9dfd079e..a6476c71 100644 --- a/plugins/wallabag/wallabag.php +++ b/plugins/wallabag/wallabag.php @@ -69,4 +69,3 @@ function wallabag_dummy_translation() t('Wallabag API URL'); t('Wallabag API version (1 or 2)'); } -