lint: apply phpcbf to plugins/

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
VirtualTam 2018-10-13 00:22:45 +02:00
parent f211e417bf
commit a0ab3c3f68
6 changed files with 16 additions and 15 deletions

View file

@ -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'));

View file

@ -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';
}
}

View file

@ -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 .'[^>]*>(.*</\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 = '<div class="markdown">'. $processedDescription . '</div>';
}

View file

@ -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,

View file

@ -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

View file

@ -69,4 +69,3 @@ function wallabag_dummy_translation()
t('Wallabag API URL');
t('Wallabag API version (1 or 2)');
}