$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'));
{
// Only execute when linklist is rendered.
if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
-
// If loggedin
if ($data['_LOGGEDIN_'] === true) {
/*
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';
}
}
|| $data['_PAGE_'] == Router::$PAGE_DAILY
|| $data['_PAGE_'] == Router::$PAGE_EDITLINK
) {
-
$data['css_files'][] = PluginManager::$PLUGINS_PATH . '/markdown/markdown.css';
}
// 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;
}
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;
}
->text($processedDescription);
$processedDescription = sanitize_html($processedDescription);
- if(!empty($processedDescription)){
+ if (!empty($processedDescription)) {
$processedDescription = '<div class="markdown">'. $processedDescription . '</div>';
}
* 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;
*
* @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,
$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
t('Wallabag API URL');
t('Wallabag API version (1 or 2)');
}
-