diff --git a/Makefile b/Makefile
index 56cf09b2..b758d1fd 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,6 @@
# Makefile for PHP code analysis & testing, documentation and release generation
BIN = vendor/bin
-PHP_SOURCE = index.php application tests plugins
-PHP_COMMA_SOURCE = index.php,application,tests,plugins
all: static_analysis_summary check_permissions test
@@ -17,14 +15,6 @@ docker_%:
rsync -az /shaarli/ ~/shaarli/
cd ~/shaarli && make $*
-##
-# Concise status of the project
-# These targets are non-blocking: || exit 0
-##
-
-static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary
- @echo
-
##
# PHP_CodeSniffer
# Detects PHP syntax errors
@@ -32,70 +22,26 @@ static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary
# - http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php
# - http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php
##
+PHPCS := $(BIN)/phpcs
-code_sniffer: code_sniffer_full
+code_sniffer:
+ @$(PHPCS)
### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend...
PHPCS_%:
- @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200 --standard=$*
+ @$(PHPCS) --report-full --report-width=200 --standard=$*
### - errors by Git author
code_sniffer_blame:
- @$(BIN)/phpcs $(PHP_SOURCE) --report-gitblame
+ @$(PHPCS) --report-gitblame
### - all errors/warnings
code_sniffer_full:
- @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200
+ @$(PHPCS) --report-full --report-width=200
### - errors grouped by kind
code_sniffer_source:
- @$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0
-
-##
-# PHP Copy/Paste Detector
-# Detects code redundancy
-# Documentation: https://github.com/sebastianbergmann/phpcpd
-##
-
-copy_paste:
- @echo "-----------------------"
- @echo "PHP COPY/PASTE DETECTOR"
- @echo "-----------------------"
- @$(BIN)/phpcpd $(PHP_SOURCE) || exit 0
- @echo
-
-##
-# PHP Mess Detector
-# Detects PHP syntax errors, sorted by category
-# Rules documentation: http://phpmd.org/rules/index.html
-##
-MESS_DETECTOR_RULES = cleancode,codesize,controversial,design,naming,unusedcode
-
-mess_title:
- @echo "-----------------"
- @echo "PHP MESS DETECTOR"
- @echo "-----------------"
-
-### - all warnings
-mess_detector: mess_title
- @$(BIN)/phpmd $(PHP_COMMA_SOURCE) text $(MESS_DETECTOR_RULES) | sed 's_.*\/__'
-
-### - all warnings + HTML output contains links to PHPMD's documentation
-mess_detector_html:
- @$(BIN)/phpmd $(PHP_COMMA_SOURCE) html $(MESS_DETECTOR_RULES) \
- --reportfile phpmd.html || exit 0
-
-### - warnings grouped by message, sorted by descending frequency order
-mess_detector_grouped: mess_title
- @$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) \
- | cut -f 2 | sort | uniq -c | sort -nr
-
-### - summary: number of warnings by rule set
-mess_detector_summary: mess_title
- @for rule in $$(echo $(MESS_DETECTOR_RULES) | tr ',' ' '); do \
- warnings=$$($(BIN)/phpmd $(PHP_COMMA_SOURCE) text $$rule | wc -l); \
- printf "$$warnings\t$$rule\n"; \
- done;
+ @$(PHPCS) --report-source || exit 0
##
# Checks source file & script permissions
diff --git a/README.md b/README.md
index 2ff54600..0e23e33d 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ _It is designed to be personal (single-user), fast and handy._
[![](https://img.shields.io/badge/stable-v0.9.7-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.9.7)
[![](https://img.shields.io/travis/shaarli/Shaarli/stable.svg?label=stable)](https://travis-ci.org/shaarli/Shaarli)
•
-[![](https://img.shields.io/badge/latest-v0.10.1-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.10.1)
+[![](https://img.shields.io/badge/latest-v0.10.2-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.10.2)
[![](https://img.shields.io/travis/shaarli/Shaarli/latest.svg?label=latest)](https://travis-ci.org/shaarli/Shaarli)
•
[![](https://img.shields.io/badge/master-v0.10.x-blue.svg)](https://github.com/shaarli/Shaarli)
diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php
index 911873a0..a3b2dcb1 100644
--- a/application/ApplicationUtils.php
+++ b/application/ApplicationUtils.php
@@ -24,7 +24,7 @@ class ApplicationUtils
*
* @return mixed the version code from the repository if available, else 'false'
*/
- public static function getLatestGitVersionCode($url, $timeout=2)
+ public static function getLatestGitVersionCode($url, $timeout = 2)
{
list($headers, $data) = get_http_response($url, $timeout);
@@ -86,13 +86,14 @@ public static function getVersion($remote, $timeout = 2)
*
* @return mixed the new version code if available and greater, else 'false'
*/
- public static function checkUpdate($currentVersion,
- $updateFile,
- $checkInterval,
- $enableCheck,
- $isLoggedIn,
- $branch='stable')
- {
+ public static function checkUpdate(
+ $currentVersion,
+ $updateFile,
+ $checkInterval,
+ $enableCheck,
+ $isLoggedIn,
+ $branch = 'stable'
+ ) {
// Do not check versions for visitors
// Do not check if the user doesn't want to
// Do not check with dev version
diff --git a/application/Base64Url.php b/application/Base64Url.php
index 61590e43..54d0fcd5 100644
--- a/application/Base64Url.php
+++ b/application/Base64Url.php
@@ -2,7 +2,6 @@
namespace Shaarli;
-
/**
* URL-safe Base64 operations
*
@@ -17,7 +16,8 @@ class Base64Url
*
* @return string Base64Url-encoded data
*/
- public static function encode($data) {
+ public static function encode($data)
+ {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
@@ -28,7 +28,8 @@ public static function encode($data) {
*
* @return string Decoded data
*/
- public static function decode($data) {
+ public static function decode($data)
+ {
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
}
diff --git a/application/FeedBuilder.php b/application/FeedBuilder.php
index ebae18b4..73fafcbe 100644
--- a/application/FeedBuilder.php
+++ b/application/FeedBuilder.php
@@ -163,7 +163,8 @@ protected function buildItem($link, $pageaddr)
$upDate = $link['updated'];
$link['up_iso_date'] = $this->getIsoDate($upDate, DateTime::ATOM);
} else {
- $link['up_iso_date'] = $this->getIsoDate($pubDate, DateTime::ATOM);;
+ $link['up_iso_date'] = $this->getIsoDate($pubDate, DateTime::ATOM);
+ ;
}
// Save the more recent item.
@@ -261,7 +262,6 @@ protected function getIsoDate(DateTime $date, $format = false)
}
if ($this->feedType == self::$FEED_RSS) {
return $date->format(DateTime::RSS);
-
}
return $date->format(DateTime::ATOM);
}
diff --git a/application/HttpUtils.php b/application/HttpUtils.php
index e9282506..9c438160 100644
--- a/application/HttpUtils.php
+++ b/application/HttpUtils.php
@@ -7,7 +7,8 @@
* @param int $timeout network timeout (in seconds)
* @param int $maxBytes maximum downloaded bytes (default: 4 MiB)
* @param callable|string $curlWriteFunction Optional callback called during the download (cURL CURLOPT_WRITEFUNCTION).
- * Can be used to add download conditions on the headers (response code, content type, etc.).
+ * Can be used to add download conditions on the
+ * headers (response code, content type, etc.).
*
* @return array HTTP response headers, downloaded content
*
@@ -64,29 +65,30 @@ function get_http_response($url, $timeout = 30, $maxBytes = 4194304, $curlWriteF
}
// General cURL settings
- curl_setopt($ch, CURLOPT_AUTOREFERER, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_HEADER, true);
+ curl_setopt($ch, CURLOPT_AUTOREFERER, true);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array('Accept-Language: ' . $acceptLanguage)
);
- curl_setopt($ch, CURLOPT_MAXREDIRS, $maxRedirs);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
- curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
+ curl_setopt($ch, CURLOPT_MAXREDIRS, $maxRedirs);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
+ curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
if (is_callable($curlWriteFunction)) {
curl_setopt($ch, CURLOPT_WRITEFUNCTION, $curlWriteFunction);
}
// Max download size management
- curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024*16);
- curl_setopt($ch, CURLOPT_NOPROGRESS, false);
- curl_setopt($ch, CURLOPT_PROGRESSFUNCTION,
- function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes)
- {
+ curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024*16);
+ curl_setopt($ch, CURLOPT_NOPROGRESS, false);
+ curl_setopt(
+ $ch,
+ CURLOPT_PROGRESSFUNCTION,
+ function ($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes) {
if (version_compare(phpversion(), '5.5', '<')) {
// PHP version lower than 5.5
// Callback has 4 arguments
@@ -232,7 +234,6 @@ function get_redirected_headers($url, $redirectionLimit = 3)
&& !empty($headers)
&& (strpos($headers[0], '301') !== false || strpos($headers[0], '302') !== false)
&& !empty($headers['Location'])) {
-
$redirection = is_array($headers['Location']) ? end($headers['Location']) : $headers['Location'];
if ($redirection != $url) {
$redirection = getAbsoluteUrl($url, $redirection);
diff --git a/application/Languages.php b/application/Languages.php
index 4fa32426..b9c5d0e8 100644
--- a/application/Languages.php
+++ b/application/Languages.php
@@ -92,7 +92,7 @@ public function __construct($language, $conf)
/**
* Initialize the translator using php gettext extension (gettext dependency act as a wrapper).
*/
- protected function initGettextTranslator ()
+ protected function initGettextTranslator()
{
$this->translator = new GettextTranslator();
$this->translator->setLanguage($this->language);
@@ -125,7 +125,8 @@ protected function initPhpTranslator()
$translations = $translations->addFromPoFile('inc/languages/'. $this->language .'/LC_MESSAGES/shaarli.po');
$translations->setDomain('shaarli');
$this->translator->loadTranslations($translations);
- } catch (\InvalidArgumentException $e) {}
+ } catch (\InvalidArgumentException $e) {
+ }
// Default extension translation from the current theme
$theme = $this->conf->get('theme');
@@ -137,7 +138,8 @@ protected function initPhpTranslator()
);
$translations->setDomain($theme);
$this->translator->loadTranslations($translations);
- } catch (\InvalidArgumentException $e) {}
+ } catch (\InvalidArgumentException $e) {
+ }
}
// Extension translations (plugins, themes, etc.).
@@ -147,10 +149,13 @@ protected function initPhpTranslator()
}
try {
- $extension = Translations::fromPoFile($translationPath . $this->language .'/LC_MESSAGES/'. $domain .'.po');
+ $extension = Translations::fromPoFile(
+ $translationPath . $this->language .'/LC_MESSAGES/'. $domain .'.po'
+ );
$extension->setDomain($domain);
$this->translator->loadTranslations($extension);
- } catch (\InvalidArgumentException $e) {}
+ } catch (\InvalidArgumentException $e) {
+ }
}
}
diff --git a/application/LinkDB.php b/application/LinkDB.php
index cd0f2967..4bbc2950 100644
--- a/application/LinkDB.php
+++ b/application/LinkDB.php
@@ -107,8 +107,7 @@ public function __construct(
$hidePublicLinks,
$redirector = '',
$redirectorEncode = true
- )
- {
+ ) {
$this->datastore = $datastore;
$this->loggedIn = $isLoggedIn;
$this->hidePublicLinks = $hidePublicLinks;
@@ -250,11 +249,14 @@ private function check()
'id' => 1,
'title'=> t('The personal, minimalist, super-fast, database free, bookmarking service'),
'url'=>'https://shaarli.readthedocs.io',
- 'description'=>t('Welcome to Shaarli! This is your first public bookmark. To edit or delete me, you must first login.
+ 'description'=>t(
+ 'Welcome to Shaarli! This is your first public bookmark. '
+ .'To edit or delete me, you must first login.
To learn how to use Shaarli, consult the link "Documentation" at the bottom of this page.
-You use the community supported version of the original Shaarli project, by Sebastien Sauvage.'),
+You use the community supported version of the original Shaarli project, by Sebastien Sauvage.'
+ ),
'private'=>0,
'created'=> new DateTime(),
'tags'=>'opensource software'
@@ -317,8 +319,7 @@ private function read()
} else {
$link['real_url'] .= $link['url'];
}
- }
- else {
+ } else {
$link['real_url'] = $link['url'];
}
@@ -403,7 +404,8 @@ public function filterHash($request)
*
* @return array list of shaare found.
*/
- public function filterDay($request) {
+ public function filterDay($request)
+ {
$linkFilter = new LinkFilter($this->links);
return $linkFilter->filter(LinkFilter::$FILTER_DAY, $request);
}
@@ -420,8 +422,12 @@ public function filterDay($request) {
*
* @return array filtered links, all links if no suitable filter was provided.
*/
- public function filterSearch($filterRequest = array(), $casesensitive = false, $visibility = 'all', $untaggedonly = false)
- {
+ public function filterSearch(
+ $filterRequest = array(),
+ $casesensitive = false,
+ $visibility = 'all',
+ $untaggedonly = false
+ ) {
// Filter link database according to parameters.
$searchtags = isset($filterRequest['searchtags']) ? escape($filterRequest['searchtags']) : '';
$searchterm = isset($filterRequest['searchterm']) ? escape($filterRequest['searchterm']) : '';
@@ -492,8 +498,7 @@ public function renameTag($from, $to)
$delete = empty($to);
// True for case-sensitive tag search.
$linksToAlter = $this->filterSearch(['searchtags' => $from], true);
- foreach($linksToAlter as $key => &$value)
- {
+ foreach ($linksToAlter as $key => &$value) {
$tags = preg_split('/\s+/', trim($value['tags']));
if (($pos = array_search($from, $tags)) !== false) {
if ($delete) {
@@ -536,7 +541,10 @@ public function reorder($order = 'DESC')
{
$order = $order === 'ASC' ? -1 : 1;
// Reorder array by dates.
- usort($this->links, function($a, $b) use ($order) {
+ usort($this->links, function ($a, $b) use ($order) {
+ if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
+ return $a['sticky'] ? -1 : 1;
+ }
return $a['created'] < $b['created'] ? 1 * $order : -1 * $order;
});
diff --git a/application/LinkFilter.php b/application/LinkFilter.php
index e52239b8..8f147974 100644
--- a/application/LinkFilter.php
+++ b/application/LinkFilter.php
@@ -62,7 +62,7 @@ public function filter($type, $request, $casesensitive = false, $visibility = 'a
$visibility = 'all';
}
- switch($type) {
+ switch ($type) {
case self::$FILTER_HASH:
return $this->filterSmallHash($request);
case self::$FILTER_TAG | self::$FILTER_TEXT: // == "vuotext"
@@ -205,7 +205,6 @@ private function filterFulltext($searchterms, $visibility = 'all')
// Iterate over every stored link.
foreach ($this->links as $id => $link) {
-
// ignore non private links when 'privatonly' is on.
if ($visibility !== 'all') {
if (! $link['private'] && $visibility === 'private') {
@@ -257,11 +256,11 @@ private function filterFulltext($searchterms, $visibility = 'all')
private static function tag2regex($tag)
{
$len = strlen($tag);
- if(!$len || $tag === "-" || $tag === "*"){
+ if (!$len || $tag === "-" || $tag === "*") {
// nothing to search, return empty regex
return '';
}
- if($tag[0] === "-") {
+ if ($tag[0] === "-") {
// query is negated
$i = 1; // use offset to start after '-' character
$regex = '(?!'; // create negative lookahead
@@ -271,14 +270,14 @@ private static function tag2regex($tag)
}
$regex .= '.*(?:^| )'; // before tag may only be a space or the beginning
// iterate over string, separating it into placeholder and content
- for(; $i < $len; $i++){
- if($tag[$i] === '*'){
+ for (; $i < $len; $i++) {
+ if ($tag[$i] === '*') {
// placeholder found
$regex .= '[^ ]*?';
} else {
// regular characters
$offset = strpos($tag, '*', $i);
- if($offset === false){
+ if ($offset === false) {
// no placeholder found, set offset to end of string
$offset = $len;
}
@@ -310,19 +309,19 @@ public function filterTags($tags, $casesensitive = false, $visibility = 'all')
{
// get single tags (we may get passed an array, even though the docs say different)
$inputTags = $tags;
- if(!is_array($tags)) {
+ if (!is_array($tags)) {
// we got an input string, split tags
$inputTags = preg_split('/(?:\s+)|,/', $inputTags, -1, PREG_SPLIT_NO_EMPTY);
}
- if(!count($inputTags)){
+ if (!count($inputTags)) {
// no input tags
return $this->noFilter($visibility);
}
// build regex from all tags
$re = '/^' . implode(array_map("self::tag2regex", $inputTags)) . '.*$/';
- if(!$casesensitive) {
+ if (!$casesensitive) {
// make regex case insensitive
$re .= 'i';
}
@@ -342,7 +341,7 @@ public function filterTags($tags, $casesensitive = false, $visibility = 'all')
}
}
$search = $link['tags']; // build search string, start with tags of current link
- if(strlen(trim($link['description'])) && strpos($link['description'], '#') !== false){
+ if (strlen(trim($link['description'])) && strpos($link['description'], '#') !== false) {
// description given and at least one possible tag found
$descTags = array();
// find all tags in the form of #tag in the description
@@ -351,13 +350,13 @@ public function filterTags($tags, $casesensitive = false, $visibility = 'all')
$link['description'],
$descTags
);
- if(count($descTags[1])){
+ if (count($descTags[1])) {
// there were some tags in the description, add them to the search string
$search .= ' ' . implode(' ', $descTags[1]);
}
};
// match regular expression with search string
- if(!preg_match($re, $search)){
+ if (!preg_match($re, $search)) {
// this entry does _not_ match our regex
continue;
}
diff --git a/application/LinkUtils.php b/application/LinkUtils.php
index 4df5c0ca..d56e019f 100644
--- a/application/LinkUtils.php
+++ b/application/LinkUtils.php
@@ -23,7 +23,7 @@ function get_curl_download_callback(&$charset, &$title, $curlGetInfo = 'curl_get
*
* @return int|bool length of $data or false if we need to stop the download
*/
- return function(&$ch, $data) use ($curlGetInfo, &$charset, &$title, &$isRedirected) {
+ return function (&$ch, $data) use ($curlGetInfo, &$charset, &$title, &$isRedirected) {
$responseCode = $curlGetInfo($ch, CURLINFO_RESPONSE_CODE);
if (!empty($responseCode) && in_array($responseCode, [301, 302])) {
$isRedirected = true;
@@ -201,7 +201,8 @@ function space2nbsp($text)
* @return string formatted description.
*/
-function format_description($description, $redirector = '', $urlEncode = true, $indexUrl = '') {
+function format_description($description, $redirector = '', $urlEncode = true, $indexUrl = '')
+{
return nl2br(space2nbsp(hashtag_autolink(text2clickable($description, $redirector, $urlEncode), $indexUrl)));
}
diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php
index b4d16d00..84dd2b20 100644
--- a/application/NetscapeBookmarkUtils.php
+++ b/application/NetscapeBookmarkUtils.php
@@ -72,18 +72,20 @@ public static function filterAndFormat($linkDb, $selection, $prependNoteUrl, $in
private static function importStatus(
$filename,
$filesize,
- $importCount=0,
- $overwriteCount=0,
- $skipCount=0,
- $duration=0
- )
- {
+ $importCount = 0,
+ $overwriteCount = 0,
+ $skipCount = 0,
+ $duration = 0
+ ) {
$status = sprintf(t('File %s (%d bytes) '), $filename, $filesize);
if ($importCount == 0 && $overwriteCount == 0 && $skipCount == 0) {
$status .= t('has an unknown file format. Nothing was imported.');
} else {
$status .= vsprintf(
- t('was successfully processed in %d seconds: %d links imported, %d links overwritten, %d links skipped.'),
+ t(
+ 'was successfully processed in %d seconds: '
+ .'%d links imported, %d links overwritten, %d links skipped.'
+ ),
[$duration, $importCount, $overwriteCount, $skipCount]
);
}
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index b1abe0d0..2ca95832 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -78,7 +78,6 @@ private function initialize()
);
$this->tpl->assign('newVersion', escape($version));
$this->tpl->assign('versionError', '');
-
} catch (Exception $exc) {
logm($this->conf->get('resource.log'), $_SERVER['REMOTE_ADDR'], $exc->getMessage());
$this->tpl->assign('newVersion', '');
@@ -101,7 +100,7 @@ private function initialize()
'version_hash',
ApplicationUtils::getVersionHash(SHAARLI_VERSION, $this->conf->get('credentials.salt'))
);
- $this->tpl->assign('scripturl', index_url($_SERVER));
+ $this->tpl->assign('index_url', index_url($_SERVER));
$visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
$this->tpl->assign('visibility', $visibility);
$this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly']));
@@ -163,7 +162,7 @@ public function assignAll($data)
$this->initialize();
}
- if (empty($data) || !is_array($data)){
+ if (empty($data) || !is_array($data)) {
return false;
}
diff --git a/application/PluginManager.php b/application/PluginManager.php
index cf603845..1ed4db4b 100644
--- a/application/PluginManager.php
+++ b/application/PluginManager.php
@@ -75,8 +75,7 @@ public function load($authorizedPlugins)
try {
$this->loadPlugin($dirs[$index], $plugin);
- }
- catch (PluginFileNotFoundException $e) {
+ } catch (PluginFileNotFoundException $e) {
error_log($e->getMessage());
}
}
diff --git a/application/Router.php b/application/Router.php
index bf86b884..beb3165b 100644
--- a/application/Router.php
+++ b/application/Router.php
@@ -37,6 +37,8 @@ class Router
public static $PAGE_DELETELINK = 'delete_link';
+ public static $PAGE_PINLINK = 'pin';
+
public static $PAGE_EXPORT = 'export';
public static $PAGE_IMPORT = 'import';
@@ -146,6 +148,10 @@ public static function findPage($query, $get, $loggedIn)
return self::$PAGE_DELETELINK;
}
+ if (startsWith($query, 'do='. self::$PAGE_PINLINK)) {
+ return self::$PAGE_PINLINK;
+ }
+
if (startsWith($query, 'do='. self::$PAGE_EXPORT)) {
return self::$PAGE_EXPORT;
}
diff --git a/application/Thumbnailer.php b/application/Thumbnailer.php
index 7d0d9c33..37ed97a1 100644
--- a/application/Thumbnailer.php
+++ b/application/Thumbnailer.php
@@ -58,7 +58,10 @@ public function __construct($conf)
$this->conf->set('thumbnails.enabled', false);
$this->conf->write(true);
// TODO: create a proper error handling system able to catch exceptions...
- die(t('php-gd extension must be loaded to use thumbnails. Thumbnails are now disabled. Please reload the page.'));
+ die(t(
+ 'php-gd extension must be loaded to use thumbnails. '
+ .'Thumbnails are now disabled. Please reload the page.'
+ ));
}
$this->wt = new WebThumbnailer();
diff --git a/application/Updater.php b/application/Updater.php
index 480bff82..6b94c5e3 100644
--- a/application/Updater.php
+++ b/application/Updater.php
@@ -183,7 +183,7 @@ public function updateMethodConfigToJson()
}
}
- try{
+ try {
$this->conf->write($this->isLoggedIn);
return true;
} catch (IOException $e) {
@@ -517,6 +517,26 @@ public function updateMethodWebThumbnailer()
return true;
}
+
+ /**
+ * Set sticky = false on all links
+ *
+ * @return bool true if the update is successful, false otherwise.
+ */
+ public function updateMethodSetSticky()
+ {
+ foreach ($this->linkDB as $key => $link) {
+ if (isset($link['sticky'])) {
+ return true;
+ }
+ $link['sticky'] = false;
+ $this->linkDB[$key] = $link;
+ }
+
+ $this->linkDB->save($this->conf->get('resource.page_cache'));
+
+ return true;
+ }
}
/**
diff --git a/application/Url.php b/application/Url.php
index 6b9870f0..3b7f19c2 100644
--- a/application/Url.php
+++ b/application/Url.php
@@ -34,8 +34,8 @@ function unparse_url($parsedUrl)
*/
function cleanup_url($url)
{
- $obj_url = new Url($url);
- return $obj_url->cleanup();
+ $obj_url = new Url($url);
+ return $obj_url->cleanup();
}
/**
@@ -47,8 +47,8 @@ function cleanup_url($url)
*/
function get_url_scheme($url)
{
- $obj_url = new Url($url);
- return $obj_url->getScheme();
+ $obj_url = new Url($url);
+ return $obj_url->getScheme();
}
/**
@@ -217,7 +217,7 @@ protected function cleanupQuery()
}
$this->parts['query'] = implode('&', $queryParams);
- }
+ }
/**
* Removes undesired fragments
@@ -269,7 +269,8 @@ public function idnToAscii()
*
* @return string the URL scheme or false if none is provided.
*/
- public function getScheme() {
+ public function getScheme()
+ {
if (!isset($this->parts['scheme'])) {
return false;
}
@@ -281,7 +282,8 @@ public function getScheme() {
*
* @return string the URL host or false if none is provided.
*/
- public function getHost() {
+ public function getHost()
+ {
if (empty($this->parts['host'])) {
return false;
}
@@ -293,7 +295,8 @@ public function getHost() {
*
* @return true is HTTP, false otherwise.
*/
- public function isHttp() {
+ public function isHttp()
+ {
return strpos(strtolower($this->parts['scheme']), 'http') !== false;
}
}
diff --git a/application/Utils.php b/application/Utils.php
index 97b12fcf..925e1a22 100644
--- a/application/Utils.php
+++ b/application/Utils.php
@@ -97,7 +97,7 @@ function escape($input)
if (is_array($input)) {
$out = array();
- foreach($input as $key => $value) {
+ foreach ($input as $key => $value) {
$out[$key] = escape($value);
}
return $out;
@@ -355,10 +355,13 @@ function return_bytes($val)
$val = trim($val);
$last = strtolower($val[strlen($val)-1]);
$val = intval(substr($val, 0, -1));
- switch($last) {
- case 'g': $val *= 1024;
- case 'm': $val *= 1024;
- case 'k': $val *= 1024;
+ switch ($last) {
+ case 'g':
+ $val *= 1024;
+ case 'm':
+ $val *= 1024;
+ case 'k':
+ $val *= 1024;
}
return $val;
}
@@ -452,6 +455,7 @@ function alphabetical_sort(&$data, $reverse = false, $byKeys = false)
*
* @return string Text translated.
*/
-function t($text, $nText = '', $nb = 1, $domain = 'shaarli') {
+function t($text, $nText = '', $nb = 1, $domain = 'shaarli')
+{
return dn__($domain, $text, $nText, $nb);
}
diff --git a/application/api/ApiMiddleware.php b/application/api/ApiMiddleware.php
index ff209393..66eac133 100644
--- a/application/api/ApiMiddleware.php
+++ b/application/api/ApiMiddleware.php
@@ -65,7 +65,7 @@ public function __invoke($request, $response, $next)
try {
$this->checkRequest($request);
$response = $next($request, $response);
- } catch(ApiException $e) {
+ } catch (ApiException $e) {
$e->setResponse($response);
$e->setDebug($this->conf->get('dev.debug', false));
$response = $e->getApiResponse();
@@ -98,7 +98,8 @@ protected function checkRequest($request)
*
* @throws ApiAuthorizationException The token couldn't be validated.
*/
- protected function checkToken($request) {
+ protected function checkToken($request)
+ {
if (! $request->hasHeader('Authorization')) {
throw new ApiAuthorizationException('JWT token not provided');
}
diff --git a/application/api/controllers/ApiController.php b/application/api/controllers/ApiController.php
index 3be85b98..9edefcf6 100644
--- a/application/api/controllers/ApiController.php
+++ b/application/api/controllers/ApiController.php
@@ -41,7 +41,7 @@ abstract class ApiController
/**
* ApiController constructor.
- *
+ *
* Note: enabling debug mode displays JSON with readable formatting.
*
* @param Container $ci Slim container.
diff --git a/application/api/controllers/History.php b/application/api/controllers/History.php
index 5cc453bf..4582e8b2 100644
--- a/application/api/controllers/History.php
+++ b/application/api/controllers/History.php
@@ -35,8 +35,7 @@ public function getHistory($request, $response)
$offset = $request->getParam('offset');
if (empty($offset)) {
$offset = 0;
- }
- elseif (ctype_digit($offset)) {
+ } elseif (ctype_digit($offset)) {
$offset = (int) $offset;
} else {
throw new ApiBadParametersException('Invalid offset');
diff --git a/application/api/controllers/Info.php b/application/api/controllers/Info.php
index 25433f72..f37dcae5 100644
--- a/application/api/controllers/Info.php
+++ b/application/api/controllers/Info.php
@@ -7,7 +7,7 @@
/**
* Class Info
- *
+ *
* REST API Controller: /info
*
* @package Api\Controllers
@@ -17,7 +17,7 @@ class Info extends ApiController
{
/**
* Service providing various information about Shaarli instance.
- *
+ *
* @param Request $request Slim request.
* @param Response $response Slim response.
*
diff --git a/application/api/exceptions/ApiException.php b/application/api/exceptions/ApiException.php
index c8490e0c..d6b66323 100644
--- a/application/api/exceptions/ApiException.php
+++ b/application/api/exceptions/ApiException.php
@@ -10,7 +10,8 @@
* Parent Exception related to the API, able to generate a valid Response (ResponseInterface).
* Also can include various information in debug mode.
*/
-abstract class ApiException extends \Exception {
+abstract class ApiException extends \Exception
+{
/**
* @var Response instance from Slim.
@@ -27,7 +28,7 @@ abstract class ApiException extends \Exception {
*
* @return Response Final response to give.
*/
- public abstract function getApiResponse();
+ abstract public function getApiResponse();
/**
* Creates ApiResponse body.
@@ -36,7 +37,8 @@ public abstract function getApiResponse();
*
* @return array|string response body
*/
- protected function getApiResponseBody() {
+ protected function getApiResponseBody()
+ {
if ($this->debug !== true) {
return $this->getMessage();
}
diff --git a/application/api/exceptions/ApiLinkNotFoundException.php b/application/api/exceptions/ApiLinkNotFoundException.php
index de7e14f5..c727f4f0 100644
--- a/application/api/exceptions/ApiLinkNotFoundException.php
+++ b/application/api/exceptions/ApiLinkNotFoundException.php
@@ -2,7 +2,6 @@
namespace Shaarli\Api\Exceptions;
-
use Slim\Http\Response;
/**
diff --git a/application/api/exceptions/ApiTagNotFoundException.php b/application/api/exceptions/ApiTagNotFoundException.php
index eed5afa5..eee152fe 100644
--- a/application/api/exceptions/ApiTagNotFoundException.php
+++ b/application/api/exceptions/ApiTagNotFoundException.php
@@ -2,7 +2,6 @@
namespace Shaarli\Api\Exceptions;
-
use Slim\Http\Response;
/**
diff --git a/application/config/ConfigPhp.php b/application/config/ConfigPhp.php
index 8add8bcd..9625fe1a 100644
--- a/application/config/ConfigPhp.php
+++ b/application/config/ConfigPhp.php
@@ -104,12 +104,20 @@ public function write($filepath, $conf)
// Store all $conf['config']
foreach ($conf['config'] as $key => $value) {
- $configStr .= '$GLOBALS[\'config\'][\''. $key .'\'] = '.var_export($conf['config'][$key], true).';'. PHP_EOL;
+ $configStr .= '$GLOBALS[\'config\'][\''
+ . $key
+ .'\'] = '
+ .var_export($conf['config'][$key], true).';'
+ . PHP_EOL;
}
if (isset($conf['plugins'])) {
foreach ($conf['plugins'] as $key => $value) {
- $configStr .= '$GLOBALS[\'plugins\'][\''. $key .'\'] = '.var_export($conf['plugins'][$key], true).';'. PHP_EOL;
+ $configStr .= '$GLOBALS[\'plugins\'][\''
+ . $key
+ .'\'] = '
+ .var_export($conf['plugins'][$key], true).';'
+ . PHP_EOL;
}
}
diff --git a/application/config/ConfigPlugin.php b/application/config/ConfigPlugin.php
index b3d9752b..dbb24937 100644
--- a/application/config/ConfigPlugin.php
+++ b/application/config/ConfigPlugin.php
@@ -34,8 +34,7 @@ function save_plugin_config($formData)
// If there is no order, it means a disabled plugin has been enabled.
if (isset($formData['order_' . $key])) {
$plugins[(int) $formData['order_' . $key]] = $key;
- }
- else {
+ } else {
$newEnabledPlugins[] = $key;
}
}
diff --git a/application/security/LoginManager.php b/application/security/LoginManager.php
index d6784d6d..0f315483 100644
--- a/application/security/LoginManager.php
+++ b/application/security/LoginManager.php
@@ -95,7 +95,6 @@ public function checkLoginState($cookie, $clientIpId)
// The user client has a valid stay-signed-in cookie
// Session information is updated with the current client information
$this->sessionManager->storeLoginInfo($clientIpId);
-
} elseif ($this->sessionManager->hasSessionExpired()
|| $this->sessionManager->hasClientIpChanged($clientIpId)
) {
diff --git a/assets/default/js/base.js b/assets/default/js/base.js
index 8bf79d3e..99e03370 100644
--- a/assets/default/js/base.js
+++ b/assets/default/js/base.js
@@ -422,12 +422,12 @@ function init(description) {
/**
* Bulk actions
*/
- const linkCheckboxes = document.querySelectorAll('.delete-checkbox');
+ const linkCheckboxes = document.querySelectorAll('.link-checkbox');
const bar = document.getElementById('actions');
[...linkCheckboxes].forEach((checkbox) => {
checkbox.style.display = 'inline-block';
- checkbox.addEventListener('click', () => {
- const linkCheckedCheckboxes = document.querySelectorAll('.delete-checkbox:checked');
+ checkbox.addEventListener('change', () => {
+ const linkCheckedCheckboxes = document.querySelectorAll('.link-checkbox:checked');
const count = [...linkCheckedCheckboxes].length;
if (count === 0 && bar.classList.contains('open')) {
bar.classList.toggle('open');
@@ -444,7 +444,7 @@ function init(description) {
event.preventDefault();
const links = [];
- const linkCheckedCheckboxes = document.querySelectorAll('.delete-checkbox:checked');
+ const linkCheckedCheckboxes = document.querySelectorAll('.link-checkbox:checked');
[...linkCheckedCheckboxes].forEach((checkbox) => {
links.push({
id: checkbox.value,
@@ -466,6 +466,25 @@ function init(description) {
});
}
+ /**
+ * Select all button
+ */
+ const selectAllButtons = document.querySelectorAll('.select-all-button');
+ [...selectAllButtons].forEach((selectAllButton) => {
+ selectAllButton.addEventListener('click', (e) => {
+ e.preventDefault();
+ const checked = selectAllButton.classList.contains('filter-off');
+ [...selectAllButtons].forEach((selectAllButton2) => {
+ selectAllButton2.classList.toggle('filter-off');
+ selectAllButton2.classList.toggle('filter-on');
+ });
+ [...linkCheckboxes].forEach((linkCheckbox) => {
+ linkCheckbox.checked = checked;
+ linkCheckbox.dispatchEvent(new Event('change'));
+ });
+ });
+ });
+
/**
* Tag list operations
*
@@ -548,7 +567,7 @@ function init(description) {
event.preventDefault();
const block = findParent(event.target, 'div', { class: 'tag-list-item' });
const tag = block.getAttribute('data-tag');
- const refreshedToken = document.getElementById('token');
+ const refreshedToken = document.getElementById('token').value;
if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
const xhr = new XMLHttpRequest();
diff --git a/assets/default/scss/shaarli.scss b/assets/default/scss/shaarli.scss
index 6b286f1e..760d8d6a 100644
--- a/assets/default/scss/shaarli.scss
+++ b/assets/default/scss/shaarli.scss
@@ -381,8 +381,6 @@ body,
box-shadow: 0 1px 0 $light-shadow, 0 1px 4px $dark-shadow inset;
background: $almost-white;
padding: 5px 5px 3px 15px;
- width: 20%;
- height: 20px;
color: $dark-grey;
}
@@ -742,7 +740,7 @@ body,
font-size: 1em;
}
- .delete-checkbox {
+ .link-checkbox {
display: none;
}
}
@@ -757,6 +755,14 @@ body,
font-size: 1.3em;
}
+.pin-link {
+ font-size: 1.3em;
+}
+
+.pinned-link {
+ color: $blue !important;
+}
+
.linklist-item-description {
position: relative;
padding: 0 10px;
@@ -850,6 +856,10 @@ body,
margin: 0 7px;
}
+.ctrl-delete {
+ margin: 0 7px 0 0;
+}
+
// 64em -> lg
@media screen and (max-width: 64em) {
.linklist-item-infos-url {
diff --git a/composer.json b/composer.json
index 99ef0b5e..dccf83b6 100644
--- a/composer.json
+++ b/composer.json
@@ -16,7 +16,7 @@
},
"require": {
"php": ">=5.6",
- "shaarli/netscape-bookmark-parser": "^2.0",
+ "shaarli/netscape-bookmark-parser": "^2.1",
"erusev/parsedown": "^1.6",
"slim/slim": "^3.0",
"arthurhoaro/web-thumbnailer": "^1.1",
@@ -24,11 +24,9 @@
"gettext/gettext": "^4.4"
},
"require-dev": {
- "phpmd/phpmd" : "@stable",
+ "phpunit/phpcov": "*",
"phpunit/phpunit": "^5.0",
- "sebastian/phpcpd": "*",
- "squizlabs/php_codesniffer": "2.*",
- "phpunit/phpcov": "*"
+ "squizlabs/php_codesniffer": "2.*"
},
"autoload": {
"psr-4": {
diff --git a/composer.lock b/composer.lock
index 22c97fa9..c43dad6f 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "da7a0c081b61d949154c5d2e5370cbab",
+ "content-hash": "3876b34296fedb365517b785af8384de",
"packages": [
{
"name": "arthurhoaro/web-thumbnailer",
@@ -133,16 +133,16 @@
},
{
"name": "gettext/gettext",
- "version": "v4.6.0",
+ "version": "v4.6.1",
"source": {
"type": "git",
"url": "https://github.com/oscarotero/Gettext.git",
- "reference": "cae84aff39a87e07bd6e5cddb5adb720a0ffa357"
+ "reference": "854ff5f5aaf92d2af7080ba8fc15718b27b5c89a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/cae84aff39a87e07bd6e5cddb5adb720a0ffa357",
- "reference": "cae84aff39a87e07bd6e5cddb5adb720a0ffa357",
+ "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/854ff5f5aaf92d2af7080ba8fc15718b27b5c89a",
+ "reference": "854ff5f5aaf92d2af7080ba8fc15718b27b5c89a",
"shasum": ""
},
"require": {
@@ -191,7 +191,7 @@
"po",
"translation"
],
- "time": "2018-06-26T16:51:09+00:00"
+ "time": "2018-08-27T15:40:19+00:00"
},
{
"name": "gettext/languages",
@@ -593,15 +593,16 @@
"source": {
"type": "git",
"url": "https://github.com/pubsubhubbub/php-publisher.git",
- "reference": "5008fc529b057251b48f4d17a10fdb20047ea8f5"
+ "reference": "047b0faf6219071527a45942d6fef4dbc6d1d884"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/pubsubhubbub/php-publisher/zipball/5008fc529b057251b48f4d17a10fdb20047ea8f5",
- "reference": "5008fc529b057251b48f4d17a10fdb20047ea8f5",
+ "url": "https://api.github.com/repos/pubsubhubbub/php-publisher/zipball/047b0faf6219071527a45942d6fef4dbc6d1d884",
+ "reference": "047b0faf6219071527a45942d6fef4dbc6d1d884",
"shasum": ""
},
"require": {
+ "ext-curl": "*",
"php": "~5.4 || ~7.0"
},
"type": "library",
@@ -626,30 +627,31 @@
"data",
"feeds",
"publishers",
- "pubsubhubbub"
+ "pubsubhubbub",
+ "websub"
],
- "time": "2018-05-22T11:56:26+00:00"
+ "time": "2018-10-09T05:20:28+00:00"
},
{
"name": "shaarli/netscape-bookmark-parser",
- "version": "v2.0.5",
+ "version": "v2.1.0",
"source": {
"type": "git",
"url": "https://github.com/shaarli/netscape-bookmark-parser.git",
- "reference": "ea6911a0ea3dd372fa7002593c5aef9c15a49315"
+ "reference": "819008ee42c4dd7e45d988176a4a22d6ed689577"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/shaarli/netscape-bookmark-parser/zipball/ea6911a0ea3dd372fa7002593c5aef9c15a49315",
- "reference": "ea6911a0ea3dd372fa7002593c5aef9c15a49315",
+ "url": "https://api.github.com/repos/shaarli/netscape-bookmark-parser/zipball/819008ee42c4dd7e45d988176a4a22d6ed689577",
+ "reference": "819008ee42c4dd7e45d988176a4a22d6ed689577",
"shasum": ""
},
"require": {
"katzgrau/klogger": "~1.0",
- "php": ">=5.3.4"
+ "php": ">=5.6"
},
"require-dev": {
- "phpunit/phpunit": "4.8.*"
+ "phpunit/phpunit": "^5.0"
},
"type": "library",
"autoload": {
@@ -681,22 +683,22 @@
"bookmark",
"link",
"netscape",
- "parse"
+ "parser"
],
- "time": "2018-01-30T17:34:48+00:00"
+ "time": "2018-10-06T14:43:38+00:00"
},
{
"name": "slim/slim",
- "version": "3.10.0",
+ "version": "3.11.0",
"source": {
"type": "git",
"url": "https://github.com/slimphp/Slim.git",
- "reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748"
+ "reference": "d378e70431e78ee92ee32ddde61ecc72edf5dc0a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/slimphp/Slim/zipball/d8aabeacc3688b25e2f2dd2db91df91ec6fdd748",
- "reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748",
+ "url": "https://api.github.com/repos/slimphp/Slim/zipball/d378e70431e78ee92ee32ddde61ecc72edf5dc0a",
+ "reference": "d378e70431e78ee92ee32ddde61ecc72edf5dc0a",
"shasum": ""
},
"require": {
@@ -754,7 +756,7 @@
"micro",
"router"
],
- "time": "2018-04-19T19:29:08+00:00"
+ "time": "2018-09-16T10:54:21+00:00"
}
],
"packages-dev": [
@@ -857,46 +859,6 @@
],
"time": "2017-10-19T19:58:43+00:00"
},
- {
- "name": "pdepend/pdepend",
- "version": "2.5.2",
- "source": {
- "type": "git",
- "url": "https://github.com/pdepend/pdepend.git",
- "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/pdepend/pdepend/zipball/9daf26d0368d4a12bed1cacae1a9f3a6f0adf239",
- "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.7",
- "symfony/config": "^2.3.0|^3|^4",
- "symfony/dependency-injection": "^2.3.0|^3|^4",
- "symfony/filesystem": "^2.3.0|^3|^4"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8|^5.7",
- "squizlabs/php_codesniffer": "^2.0.0"
- },
- "bin": [
- "src/bin/pdepend"
- ],
- "type": "library",
- "autoload": {
- "psr-4": {
- "PDepend\\": "src/main/php/PDepend"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "description": "Official version of pdepend to be handled with Composer",
- "time": "2017-12-13T13:21:38+00:00"
- },
{
"name": "phpdocumentor/reflection-common",
"version": "1.0.1",
@@ -1043,72 +1005,6 @@
],
"time": "2017-07-14T14:27:02+00:00"
},
- {
- "name": "phpmd/phpmd",
- "version": "2.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/phpmd/phpmd.git",
- "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374",
- "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374",
- "shasum": ""
- },
- "require": {
- "ext-xml": "*",
- "pdepend/pdepend": "^2.5",
- "php": ">=5.3.9"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.0",
- "squizlabs/php_codesniffer": "^2.0"
- },
- "bin": [
- "src/bin/phpmd"
- ],
- "type": "project",
- "autoload": {
- "psr-0": {
- "PHPMD\\": "src/main/php"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Manuel Pichler",
- "email": "github@manuel-pichler.de",
- "homepage": "https://github.com/manuelpichler",
- "role": "Project Founder"
- },
- {
- "name": "Other contributors",
- "homepage": "https://github.com/phpmd/phpmd/graphs/contributors",
- "role": "Contributors"
- },
- {
- "name": "Marc Würth",
- "email": "ravage@bluewin.ch",
- "homepage": "https://github.com/ravage84",
- "role": "Project Maintainer"
- }
- ],
- "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.",
- "homepage": "http://phpmd.org/",
- "keywords": [
- "mess detection",
- "mess detector",
- "pdepend",
- "phpmd",
- "pmd"
- ],
- "time": "2017-01-20T14:41:10+00:00"
- },
{
"name": "phpspec/prophecy",
"version": "1.8.0",
@@ -1987,56 +1883,6 @@
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2017-02-18T15:18:39+00:00"
},
- {
- "name": "sebastian/phpcpd",
- "version": "3.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/phpcpd.git",
- "reference": "dfed51c1288790fc957c9433e2f49ab152e8a564"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/dfed51c1288790fc957c9433e2f49ab152e8a564",
- "reference": "dfed51c1288790fc957c9433e2f49ab152e8a564",
- "shasum": ""
- },
- "require": {
- "php": "^5.6|^7.0",
- "phpunit/php-timer": "^1.0.6",
- "sebastian/finder-facade": "^1.1",
- "sebastian/version": "^1.0|^2.0",
- "symfony/console": "^2.7|^3.0|^4.0"
- },
- "bin": [
- "phpcpd"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Copy/Paste Detector (CPD) for PHP code.",
- "homepage": "https://github.com/sebastianbergmann/phpcpd",
- "time": "2017-11-16T08:49:28+00:00"
- },
{
"name": "sebastian/recursion-context",
"version": "2.0.0",
@@ -2253,82 +2099,18 @@
],
"time": "2017-05-22T02:43:20+00:00"
},
- {
- "name": "symfony/config",
- "version": "v3.4.14",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/config.git",
- "reference": "7b08223b7f6abd859651c56bcabf900d1627d085"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/7b08223b7f6abd859651c56bcabf900d1627d085",
- "reference": "7b08223b7f6abd859651c56bcabf900d1627d085",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8",
- "symfony/filesystem": "~2.8|~3.0|~4.0",
- "symfony/polyfill-ctype": "~1.8"
- },
- "conflict": {
- "symfony/dependency-injection": "<3.3",
- "symfony/finder": "<3.3"
- },
- "require-dev": {
- "symfony/dependency-injection": "~3.3|~4.0",
- "symfony/event-dispatcher": "~3.3|~4.0",
- "symfony/finder": "~3.3|~4.0",
- "symfony/yaml": "~3.0|~4.0"
- },
- "suggest": {
- "symfony/yaml": "To use the yaml reference dumper"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Config\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Config Component",
- "homepage": "https://symfony.com",
- "time": "2018-07-26T11:19:56+00:00"
- },
{
"name": "symfony/console",
- "version": "v3.4.14",
+ "version": "v3.4.17",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73"
+ "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/6b217594552b9323bcdcfc14f8a0ce126e84cd73",
- "reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73",
+ "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b",
+ "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b",
"shasum": ""
},
"require": {
@@ -2384,20 +2166,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2018-07-26T11:19:56+00:00"
+ "time": "2018-10-02T16:33:53+00:00"
},
{
"name": "symfony/debug",
- "version": "v3.4.14",
+ "version": "v3.4.17",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc"
+ "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/d5a058ff6ecad26b30c1ba452241306ea34c65cc",
- "reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6",
+ "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6",
"shasum": ""
},
"require": {
@@ -2440,141 +2222,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2018-07-26T11:19:56+00:00"
- },
- {
- "name": "symfony/dependency-injection",
- "version": "v3.4.14",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/dependency-injection.git",
- "reference": "1c0e679e522591fd744fdf242fec41a43d62b2b1"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1c0e679e522591fd744fdf242fec41a43d62b2b1",
- "reference": "1c0e679e522591fd744fdf242fec41a43d62b2b1",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8",
- "psr/container": "^1.0"
- },
- "conflict": {
- "symfony/config": "<3.3.7",
- "symfony/finder": "<3.3",
- "symfony/proxy-manager-bridge": "<3.4",
- "symfony/yaml": "<3.4"
- },
- "provide": {
- "psr/container-implementation": "1.0"
- },
- "require-dev": {
- "symfony/config": "~3.3|~4.0",
- "symfony/expression-language": "~2.8|~3.0|~4.0",
- "symfony/yaml": "~3.4|~4.0"
- },
- "suggest": {
- "symfony/config": "",
- "symfony/expression-language": "For using expressions in service container configuration",
- "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
- "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
- "symfony/yaml": ""
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\DependencyInjection\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony DependencyInjection Component",
- "homepage": "https://symfony.com",
- "time": "2018-07-29T15:19:31+00:00"
- },
- {
- "name": "symfony/filesystem",
- "version": "v3.4.14",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/filesystem.git",
- "reference": "a59f917e3c5d82332514cb4538387638f5bde2d6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/a59f917e3c5d82332514cb4538387638f5bde2d6",
- "reference": "a59f917e3c5d82332514cb4538387638f5bde2d6",
- "shasum": ""
- },
- "require": {
- "php": "^5.5.9|>=7.0.8",
- "symfony/polyfill-ctype": "~1.8"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Filesystem\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Filesystem Component",
- "homepage": "https://symfony.com",
- "time": "2018-07-26T11:19:56+00:00"
+ "time": "2018-10-02T16:33:53+00:00"
},
{
"name": "symfony/finder",
- "version": "v3.4.14",
+ "version": "v3.4.17",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a"
+ "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/8a84fcb207451df0013b2c74cbbf1b62d47b999a",
- "reference": "8a84fcb207451df0013b2c74cbbf1b62d47b999a",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d",
+ "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d",
"shasum": ""
},
"require": {
@@ -2610,7 +2271,7 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2018-07-26T11:19:56+00:00"
+ "time": "2018-10-03T08:46:40+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -2731,16 +2392,16 @@
},
{
"name": "symfony/yaml",
- "version": "v3.4.14",
+ "version": "v3.4.17",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2"
+ "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/810af2d35fc72b6cf5c01116806d2b65ccaaf2e2",
- "reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f",
+ "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f",
"shasum": ""
},
"require": {
@@ -2786,7 +2447,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2018-07-26T11:19:56+00:00"
+ "time": "2018-10-02T16:33:53+00:00"
},
{
"name": "theseer/fdomdocument",
@@ -2882,8 +2543,7 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
- "pubsubhubbub/publisher": 20,
- "phpmd/phpmd": 0
+ "pubsubhubbub/publisher": 20
},
"prefer-stable": false,
"prefer-lowest": false,
diff --git a/doc/custom_theme/main.html b/doc/custom_theme/main.html
new file mode 100644
index 00000000..cc2a703e
--- /dev/null
+++ b/doc/custom_theme/main.html
@@ -0,0 +1,23 @@
+{% extends "base.html" %}
+
+{#
+The entry point for the ReadTheDocs Theme.
+
+Any theme customisations should override this file to redefine blocks defined in
+the various templates. The custom theme should only need to define a main.html
+which `{% extends "base.html" %}` and defines various blocks which will replace
+the blocks defined in base.html and its included child templates.
+#}
+
+{%- block site_meta %}
+
+
+
+
+{%- if 'media.readthedocs.org' not in config.extra_css[0] %}
+
+{%- endif %}
+
+{% if page and page.is_homepage %}{% endif %}
+{% if config.site_author %}{% endif %}
+{%- endblock %}
diff --git a/doc/md/Community-&-Related-software.md b/doc/md/Community-&-Related-software.md
index 49c20c9c..67fdd70f 100644
--- a/doc/md/Community-&-Related-software.md
+++ b/doc/md/Community-&-Related-software.md
@@ -51,7 +51,7 @@ See [Theming](Theming) for a list of community-contributed themes, and an instal
- [Shaarlo](https://github.com/DMeloni/shaarlo) - An aggregator for shaarlis with many features (a very popular running instance among French shaarliers: [shaarli.fr](http://shaarli.fr/))
- [Shaarlimages](https://github.com/BoboTiG/shaarlimages) - An image-oriented aggregator for Shaarlis
- [mknexen/shaarli-api](https://github.com/mknexen/shaarli-api) - A REST API for Shaarli
-- [Self dead link](https://github.com/qwertygc/shaarli-dev-code/blob/master/self-dead-link.php) - Detect dead links on shaarli. This version use the database of shaarli. [Another version](https://github.com/qwertygc/shaarli-dev-code/blob/master/dead-link.php), can be used for other shaarli instances (but is more resource consuming).
+- [Self dead link](https://framagit.org/qwertygc/shaarli-dev-code/blob/master/self-dead-link.php) - Detect dead links on shaarli. This version use the database of shaarli. [Another version](https://framagit.org/qwertygc/shaarli-dev-code/blob/master/dead-link.php), can be used for other shaarli instances (but is more resource consuming).
- [Bookmark Archiver](https://github.com/pirate/bookmark-archiver) - Save an archived copy of all websites starred using browser bookmarks/Shaarli/Delicious/Instapaper/Unmark.it/Pocket/Pinboard. Outputs browseable html.
## Alternatives to Shaarli
diff --git a/doc/md/Server-configuration.md b/doc/md/Server-configuration.md
index e281dc85..78083a46 100644
--- a/doc/md/Server-configuration.md
+++ b/doc/md/Server-configuration.md
@@ -18,7 +18,7 @@ Version | Status | Shaarli compatibility
7.2 | Supported | Yes
7.1 | Supported | Yes
7.0 | Supported | Yes
-5.6 | Supported | Yes
+5.6 | EOL: 2018-12-31 | Yes (up to Shaarli 0.10.x)
5.5 | EOL: 2016-07-10 | Yes
5.4 | EOL: 2015-09-14 | Yes (up to Shaarli 0.8.x)
5.3 | EOL: 2014-08-14 | Yes (up to Shaarli 0.8.x)
@@ -397,6 +397,7 @@ http {
```
## Proxies
+
If Shaarli is served behind a proxy (i.e. there is a proxy server between clients and the web server hosting Shaarli), please refer to the proxy server documentation for proper configuration. In particular, you have to ensure that the following server variables are properly set:
- `X-Forwarded-Proto`
@@ -405,6 +406,12 @@ If Shaarli is served behind a proxy (i.e. there is a proxy server between client
See also [proxy-related](https://github.com/shaarli/Shaarli/issues?utf8=%E2%9C%93&q=label%3Aproxy+) issues.
+## Robots and crawlers
+
+Shaarli disallows indexing and crawling of your local documentation pages by search engines, using `` HTML tags.
+Your Shaarli instance and other pages you host may still be indexed by various robots on the public Internet.
+You may want to setup a robots.txt file or other crawler control mechanism on your server.
+See [[1]](https://en.wikipedia.org/wiki/Robots_exclusion_standard), [[2]](https://support.google.com/webmasters/answer/6062608?hl=en) and [[3]](https://developers.google.com/search/reference/robots_meta_tag)
## See also
diff --git a/doc/md/Sharing-content.md b/doc/md/Sharing-content.md
index 4910ff6c..9a16fc62 100644
--- a/doc/md/Sharing-content.md
+++ b/doc/md/Sharing-content.md
@@ -15,7 +15,6 @@ While logged in to your Shaarli, you can add new Shaares in several ways:
* [+Shaare button](#shaare-button)
* [Bookmarklet](#bookmarklet)
- * [Firefox Share](#firefox-share)
* Third-party [apps and browser addons](Community-&-Related-software.md#mobile-apps)
* [REST API](https://shaarli.github.io/api-documentation/)
@@ -52,22 +51,6 @@ bookmarklet in your browser! The same `New Shaare` dialog as above is displayed.
![](images/bookmarklet.png)
-### Firefox Share
-
-Before using Firefox Share, you must first add Shaarli as a sharing provider:
-
-- Click the `Tools` button in the top bar
-- Click the `✚Add to Firefox social` button and accept the activation.
-
-Once this is done, you can share any URL you are visiting by clicking the Firefox
-_Share_ button ![images/firefoxshare.png](images/firefoxshare.png)
-
-| Note | Firefox Share is no longer available for Firefox 57 and later versions. |
-|---------|---------|
-
-| Note | Your Shaarli instance must be hosted on an HTTPS (SSL/TLS secure connection) enabled server for Firefox Share to work. Firefox Share will not work over plaintext HTTP connections. |
-|---------|---------|
-
--------------------------------------------------------------------------------
## Editing Shaares
diff --git a/doc/md/images/icon.png b/doc/md/images/icon.png
new file mode 100644
index 00000000..530d7469
Binary files /dev/null and b/doc/md/images/icon.png differ
diff --git a/doc/md/index.md b/doc/md/index.md
index c18332b4..220eeec1 100644
--- a/doc/md/index.md
+++ b/doc/md/index.md
@@ -1,25 +1,19 @@
-# [Shaarli](https://github.com/shaarli/Shaarli/) documentation
+# Shaarli
The personal, minimalist, super-fast, database free, bookmarking service.
Do you want to share the links you discover?
-Shaarli is a minimalist link sharing service that you can install on your own server.
+Shaarli is a minimalist bookmark manager and link sharing service that you can install on your own server.
It is designed to be personal (single-user), fast and handy.
-Here you can find some info on how to use, configure, tweak and solve problems with your Shaarli.
-For general information, read the [README](https://github.com/shaarli/Shaarli/blob/master/README.md).
+Visit the pages in the sidebar to find information on how to setup, use, configure, tweak and troubleshoot Shaarli.
-If you have any questions or ideas, please join the [chat](https://gitter.im/shaarli/Shaarli) (also reachable via [IRC](https://irc.gitter.im/)), post them in our [general discussion](https://github.com/shaarli/Shaarli/issues/308) or read the current [issues](https://github.com/shaarli/Shaarli/issues).
-
-If you've found a bug, please create a [new issue](https://github.com/shaarli/Shaarli/issues/new).
-
-If you would like a feature added to Shaarli, check the issues labeled [`feature`](https://github.com/shaarli/Shaarli/labels/feature), [`enhancement`](https://github.com/shaarli/Shaarli/labels/enhancement), and [`plugin`](https://github.com/shaarli/Shaarli/labels/plugin).
* [GitHub project page](https://github.com/shaarli/Shaarli)
-* [Online documentation](https://shaarli.readthedocs.io/) (this page)
-* [Latest Shaarli releases](https://github.com/shaarli/Shaarli/releases)
+* [Online documentation](https://shaarli.readthedocs.io/)
+* [Latest releases](https://github.com/shaarli/Shaarli/releases)
* [Changelog](https://github.com/shaarli/Shaarli/blob/master/CHANGELOG.md)
@@ -30,87 +24,70 @@ It runs the latest development version of Shaarli and is updated/reset daily.
Login: `demo`; Password: `demo`
-
-
-
## Features
Shaarli can be used:
-- to share, comment and save interesting links and news.
-- to bookmark useful/frequent personal links (as private links) and share them between computers.
-- as a minimal blog/microblog/writing platform (no character limit).
-- as a read-it-later list (for example items tagged `readlater`).
-- to draft and save articles/posts/ideas.
-- to keep code snippets.
-- to keep notes and documentation.
-- as a shared clipboard/notepad/pastebin between machines.
-- as a todo list.
-- to store playlists (e.g. with the `music` or `video` tags).
+- to share, comment and save interesting links and news
+- to bookmark useful/frequent links and share them between computers
+- as a minimal blog/microblog/writing platform
+- as a read-it-later list
+- to draft and save articles/posts/ideas
+- to keep notes, documentation and code snippets
+- as a shared clipboard/notepad/pastebin between machines
+- as a todo list
+- to store media playlists
- to keep extracts/comments from webpages that may disappear.
-- to keep track of ongoing discussions (for example items tagged `discussion`).
-- [to feed RSS aggregators](http://shaarli.chassegnouf.net/?9Efeiw) (planets) with specific tags.
-- to feed other social networks, blogs... using RSS feeds and external services (dlvr.it, ifttt.com ...).
+- to keep track of ongoing discussions
+- to feed other blogs, aggregators, social networks... using RSS feeds
-### Interface
+### Edit, view and search your links
-- minimalist design (simple is beautiful)
+- Minimalist design
- FAST
-- ATOM and RSS feeds
-- views:
- - paginated link list (with image and video thumbnails)
- - tag cloud
- - picture wall: image and video thumbnails (with lazy loading)
- - daily: newspaper-like daily digest
- - daily RSS feed
-- permalinks for easy reference
-- links can be public or private
-- thumbnail generation for images and video services
+- Customizable link titles and descriptions
+- Tags to organize your links (features tag autocompletion, renaming, merging and deletion)
+- Search by tag or using the full-text search
+- Public and private links (visible only to logged-in users)
+- Unique permalinks for easy reference
+- Paginated link list (with image and video thumbnails)
+- Tag cloud and list views
+- Picture wall: image and video thumbnails view (with lazy loading)
+- ATOM and RSS feeds (can also be filtered using tags or text search)
+- Daily: newspaper-like daily digest (and daily RSS feed)
- URL cleanup: automatic removal of `?utm_source=...`, `fb=...`
-- extensible through [plugins](https://shaarli.readthedocs.io/en/master/Plugins/#plugin-usage)
-
-### Tag, view and search your links
-
-- add a custom title and description to archived links
-- add tags to classify and search links
- - features tag autocompletion, renaming, merging and deletion
-- full-text and tag search
+- Extensible through [plugins](https://shaarli.readthedocs.io/en/master/Plugins/#plugin-usage)
### Easy setup
-- dead-simple installation: drop the files, open the page
-- links are stored in a file
- - compact storage
- - no database required
- - easy backup: simply copy the datastore file
-- import and export links as Netscape bookmarks
+- Dead-simple installation: drop the files, open the page
+- Links are stored in a file (no database required, easy backup: simply copy the datastore file)
+- Import and export links as Netscape bookmarks compatible with most Web browsers
### Accessibility
-- bookmarlet to share links in one click
-- support for mobile browsers
-- degrades gracefully with Javascript disabled
-- easy page customization through HTML/CSS/RainTPL
+- Bookmarklet and other tools to share links in one click
+- Support for mobile browsers
+- Degrades gracefully with Javascript disabled
+- Easy page customization through HTML/CSS/RainTPL
### Security
-- discreet pop-up notification when a new release is available
-- bruteforce protection on the login form
-- protected against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) and session cookie hijacking
+- Discreet pop-up notification when a new release is available
+- Bruteforce protection on the login form
+- Protected against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) and session cookie hijacking
### REST API
-Easily extensible by any client using the REST API exposed by Shaarli.
-
-See the [API documentation](http://shaarli.github.io/api-documentation/).
+- Easily extensible by any client using the REST API exposed by Shaarli ([API documentation](http://shaarli.github.io/api-documentation/)).
## About
### Shaarli community fork
-This friendly fork is maintained by the Shaarli community at https://github.com/shaarli/Shaarli
+This friendly fork is maintained by the Shaarli community at '));
+
+ $this->assertEquals($markdown, $data['links'][0]['description_src']);
}
/**
@@ -106,6 +108,18 @@ public function testReverseText2clickable()
$this->assertEquals($text, $reversedText);
}
+ /**
+ * Test reverse_text2clickable().
+ */
+ public function testReverseText2clickableHashtags()
+ {
+ $text = file_get_contents('tests/plugins/resources/hashtags.raw');
+ $md = file_get_contents('tests/plugins/resources/hashtags.md');
+ $clickableText = hashtag_autolink($text);
+ $reversedText = reverse_text2clickable($clickableText);
+ $this->assertEquals($md, $reversedText);
+ }
+
/**
* Test reverse_nl2br().
*/
@@ -246,7 +260,7 @@ public function testMarkdownGlobalProcessDescription()
$this->conf->get('security.markdown_escape', true),
$this->conf->get('security.allowed_protocols')
);
- $this->assertEquals($html, $data);
+ $this->assertEquals($html, $data . PHP_EOL);
}
/**
diff --git a/tests/plugins/PluginQrcodeTest.php b/tests/plugins/PluginQrcodeTest.php
index ebfadddf..dd632eee 100644
--- a/tests/plugins/PluginQrcodeTest.php
+++ b/tests/plugins/PluginQrcodeTest.php
@@ -15,7 +15,8 @@ class PluginQrcodeTest extends PHPUnit_Framework_TestCase
/**
* Reset plugin path
*/
- public function setUp() {
+ public function setUp()
+ {
PluginManager::$PLUGINS_PATH = 'plugins';
}
diff --git a/tests/plugins/resources/hashtags.md b/tests/plugins/resources/hashtags.md
new file mode 100644
index 00000000..46326de3
--- /dev/null
+++ b/tests/plugins/resources/hashtags.md
@@ -0,0 +1,10 @@
+[#lol](?addtag=lol)
+
+ #test
+
+`#test2`
+
+```
+bla #bli blo
+#bla
+```
diff --git a/tests/plugins/resources/hashtags.raw b/tests/plugins/resources/hashtags.raw
new file mode 100644
index 00000000..9d2dc98a
--- /dev/null
+++ b/tests/plugins/resources/hashtags.raw
@@ -0,0 +1,10 @@
+#lol
+
+ #test
+
+`#test2`
+
+```
+bla #bli blo
+#bla
+```
diff --git a/tests/plugins/resources/markdown.html b/tests/plugins/resources/markdown.html
index f1df4e7e..c3460bf7 100644
--- a/tests/plugins/resources/markdown.html
+++ b/tests/plugins/resources/markdown.html
@@ -12,11 +12,11 @@
<a href="?addtag=foobar" title="Hashtag foobar">#foobar</a> foo fsdfs http://link.tld <a href="?addtag=foobar" title="Hashtag foobar">#foobar</a> fsdfs http://link.tld #foobar Block:Sessions do not seem to work correctly on your server.
+ *
*/
$form = array(
'attr' => array(
@@ -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/isso/comment.png b/plugins/isso/comment.png
new file mode 100644
index 00000000..0158c03b
Binary files /dev/null and b/plugins/isso/comment.png differ
diff --git a/plugins/isso/isso.php b/plugins/isso/isso.php
index 5bc1cce2..378c11af 100644
--- a/plugins/isso/isso.php
+++ b/plugins/isso/isso.php
@@ -46,9 +46,36 @@ function hook_isso_render_linklist($data, $conf)
$isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']);
$data['plugin_end_zone'][] = $isso;
+ } else {
+ $button = '';
+ // For the default theme we use a FontAwesome icon which is better than an image
+ if ($conf->get('resource.theme') === 'default') {
+ $button .= '';
+ } else {
+ $button .= '
+
+
+
+
diff --git a/plugins/markdown/markdown.php b/plugins/markdown/markdown.php
index 821bb125..8823af91 100644
--- a/plugins/markdown/markdown.php
+++ b/plugins/markdown/markdown.php
@@ -28,6 +28,7 @@ function hook_markdown_render_linklist($data, $conf)
$value = stripNoMarkdownTag($value);
continue;
}
+ $value['description_src'] = $value['description'];
$value['description'] = process_markdown(
$value['description'],
$conf->get('security.markdown_escape', true),
@@ -138,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';
}
@@ -194,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;
}
@@ -215,6 +214,15 @@ function reverse_text2clickable($description)
$descriptionLine
);
+ // Make hashtag links markdown ready, otherwise the links will be ignored with escape set to true
+ if (!$codeBlockOn && !$codeLineOn) {
+ $descriptionLine = preg_replace(
+ '#([^<]+)#m',
+ '[$2]($1)',
+ $descriptionLine
+ );
+ }
+
$descriptionOut .= $descriptionLine;
if ($lineCount++ < count($descriptionLines) - 1) {
$descriptionOut .= PHP_EOL;
@@ -292,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;
}
@@ -331,7 +343,7 @@ function process_markdown($description, $escape = true, $allowedProtocols = [])
->text($processedDescription);
$processedDescription = sanitize_html($processedDescription);
- if(!empty($processedDescription)){
+ if (!empty($processedDescription)) {
$processedDescription = '
Make sure the "
@@ -431,16 +424,16 @@ msgid ""
"custom hostname without a dot causes cookie storage to fail. We recommend "
"accessing your server via it's IP address or Fully Qualified Domain Name.
"
msgstr ""
-"Les sesssions ne semble pas fonctionner sur ce serveur.
Assurez vous "
-"que la variable « session.save_path » est correctement définie dans votre "
-"fichier de configuration PHP, et que vous y avez les droits d'écriture."
-"
Ce paramètre pointe actuellement sur %s.
Sur certains navigateurs, "
-"accéder à votre serveur depuis un nom d'hôte comme « localhost » ou autre "
-"nom personnalisé sans point '.' entraine l'échec de la sauvegarde des "
-"cookies. Nous vous recommandons d'accéder à votre serveur depuis son adresse "
-"IP ou un Fully Qualified Domain Name.
"
+"Les sesssions ne semblent pas fonctionner sur ce serveur.
';
die;
}
- if (!isset($_SESSION['session_tested']))
- { // Step 1 : Try to store data in session and reload page.
+ if (!isset($_SESSION['session_tested'])) {
+ // Step 1 : Try to store data in session and reload page.
$_SESSION['session_tested'] = 'Working'; // Try to set a variable in session.
header('Location: '.index_url($_SERVER).'?test_session'); // Redirect to check stored data.
}
- if (isset($_GET['test_session']))
- { // Step 3: Sessions are OK. Remove test parameter from URL.
+ if (isset($_GET['test_session'])) {
+ // Step 3: Sessions are OK. Remove test parameter from URL.
header('Location: '.index_url($_SERVER));
}
- if (!empty($_POST['setlogin']) && !empty($_POST['setpassword']))
- {
+ if (!empty($_POST['setlogin']) && !empty($_POST['setpassword'])) {
$tz = 'UTC';
if (!empty($_POST['continent']) && !empty($_POST['city'])
&& isTimeZoneValid($_POST['continent'], $_POST['city'])
@@ -1787,18 +1831,20 @@ function install($conf, $sessionManager, $loginManager) {
try {
// Everything is ok, let's create config file.
$conf->write($loginManager->isLoggedIn());
- }
- catch(Exception $e) {
+ } catch (Exception $e) {
error_log(
- 'ERROR while writing config file after installation.' . PHP_EOL .
+ 'ERROR while writing config file after installation.' . PHP_EOL .
$e->getMessage()
- );
+ );
// TODO: do not handle exceptions/errors in JS.
echo '';
exit;
}
- echo '';
+ echo '';
exit;
}
@@ -1822,7 +1868,7 @@ function install($conf, $sessionManager, $loginManager) {
try {
$history = new History($conf->get('resource.history'));
-} catch(Exception $e) {
+} catch (Exception $e) {
die($e->getMessage());
}
@@ -1841,7 +1887,7 @@ function install($conf, $sessionManager, $loginManager) {
$app = new \Slim\App($container);
// REST API routes
-$app->group('/api/v1', function() {
+$app->group('/api/v1', function () {
$this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo')->setName('getInfo');
$this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks')->setName('getLinks');
$this->get('/links/{id:[\d]+}', '\Shaarli\Api\Controllers\Links:getLink')->setName('getLink');
@@ -1858,6 +1904,7 @@ function install($conf, $sessionManager, $loginManager) {
})->add('\Shaarli\Api\ApiMiddleware');
$response = $app->run(true);
+
// Hack to make Slim and Shaarli router work together:
// If a Slim route isn't found and NOT API call, we call renderPage().
if ($response->getStatusCode() == 404 && strpos($_SERVER['REQUEST_URI'], '/api/v1') === false) {
@@ -1865,5 +1912,12 @@ function install($conf, $sessionManager, $loginManager) {
header('Content-Type: text/html; charset=utf-8');
renderPage($conf, $pluginManager, $linkDb, $history, $sessionManager, $loginManager);
} else {
+ $response = $response
+ ->withHeader('Access-Control-Allow-Origin', '*')
+ ->withHeader(
+ 'Access-Control-Allow-Headers',
+ 'X-Requested-With, Content-Type, Accept, Origin, Authorization'
+ )
+ ->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
$app->respond($response);
}
diff --git a/mkdocs.yml b/mkdocs.yml
index 941fce3a..248fdbfe 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -2,7 +2,9 @@ site_name: Shaarli Documentation
repo_url: https://github.com/shaarli/Shaarli
edit_uri: edit/master/doc/md
site_description: The personal, minimalist, super-fast, database free, bookmarking service
-theme: readthedocs
+theme:
+ name: readthedocs
+ custom_dir: doc/custom_theme/
docs_dir: doc/md
site_dir: doc/html
# Disable strict mode until ReadTheDocs provides up-to-date MkDocs settings:
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 00000000..29b95d56
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,17 @@
+
+
Assurez "
+"vous que la variable « session.save_path » est correctement définie dans "
+"votre fichier de configuration PHP, et que vous avez les droits d'écriture "
+"dessus.
Ce paramètre pointe actuellement sur %s.
Sur certains "
+"navigateurs, accéder à votre serveur depuis un nom d'hôte comme « localhost "
+"» ou autre nom personnalisé sans point '.' entraine l'échec de la sauvegarde "
+"des cookies. Nous vous recommandons d'accéder à votre serveur depuis son "
+"adresse IP ou un Fully Qualified Domain Name.
"
-#: index.php:1745
+#: index.php:1764
msgid "Click to try again."
msgstr "Cliquer ici pour réessayer."
@@ -455,7 +448,7 @@ msgstr "Shaare"
#: plugins/addlink_toolbar/addlink_toolbar.php:50
msgid "Adds the addlink input on the linklist page."
-msgstr "Ajout le formulaire d'ajout de liens sur la page principale."
+msgstr "Ajoute le formulaire d'ajout de liens sur la page principale."
#: plugins/archiveorg/archiveorg.php:23
msgid "View on archive.org"
@@ -471,7 +464,7 @@ msgid ""
"developers."
msgstr ""
"Une extension de démonstration couvrant tous les cas d'utilisation pour les "
-"designers et les développeurs."
+"designers de thèmes et les développeurs d'extensions."
#: plugins/isso/isso.php:20
msgid ""
@@ -481,12 +474,13 @@ msgstr ""
"Erreur de l'extension Isso : Merci de définir le paramètre « ISSO_SERVER » "
"dans la page d'administration des extensions."
-#: plugins/isso/isso.php:63
+#: plugins/isso/isso.php:90
msgid "Let visitor comment your shaares on permalinks with Isso."
msgstr ""
-"Permet aux visiteurs de commenter vos shaares sur les permaliens avec Isso."
+"Permettre aux visiteurs de commenter vos shaares sur les permaliens avec "
+"Isso."
-#: plugins/isso/isso.php:64
+#: plugins/isso/isso.php:91
msgid "Isso server URL (without 'http://')"
msgstr "URL du serveur Isso (sans 'http://')"
@@ -578,7 +572,7 @@ msgstr "Active la publication de flux vers PubSubHubbub."
#: plugins/qrcode/qrcode.php:69 plugins/wallabag/wallabag.php:68
msgid "For each link, add a QRCode icon."
-msgstr "Pour chaque liens, ajouter une icône de QRCode."
+msgstr "Pour chaque lien, ajouter une icône de QRCode."
#: plugins/wallabag/wallabag.php:21
msgid ""
@@ -603,35 +597,17 @@ msgstr "Version de l'API Wallabag (1 ou 2)"
#: tests/LanguagesTest.php:214 tests/LanguagesTest.php:227
#: tests/languages/fr/LanguagesFrTest.php:160
#: tests/languages/fr/LanguagesFrTest.php:173
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:85
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:85
msgid "Search"
msgid_plural "Search"
msgstr[0] "Rechercher"
msgstr[1] "Rechercher"
-#: tmp/404.b91ef64efc3688266305ea9b42e5017e.rtpl.php:12
-msgid "Sorry, nothing to see here."
-msgstr "Désolé, il y a rien à voir ici."
-
#: tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
msgid "URL or leave empty to post a note"
msgstr "URL ou laisser vide pour créer une note"
-#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-msgid "Current password"
-msgstr "Mot de passe actuel"
-
-#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
-msgid "New password"
-msgstr "Nouveau mot de passe"
-
-#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:23
-msgid "Change"
-msgstr "Changer"
-
#: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:77
msgid "Tag"
msgstr "Tag"
@@ -661,6 +637,34 @@ msgstr "Vous pouvez aussi modifier les tags dans la"
msgid "tag list"
msgstr "liste des tags"
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:143
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:296
+msgid "All"
+msgstr "Tous"
+
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:147
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:300
+msgid "Only common media hosts"
+msgstr "Seulement les hébergeurs de média connus"
+
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:151
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:304
+msgid "None"
+msgstr "Aucune"
+
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:158
+#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:281
+msgid "You need to enable the extension php-gd
to use thumbnails."
+msgstr ""
+"Vous devez activer l'extension php-gd
pour utiliser les "
+"miniatures."
+
+#: tmp/configure.90100d2eaf5d3705e14b9b4f78ecddc9.rtpl.php:162
+#, fuzzy
+#| msgid "Enable thumbnails"
+msgid "Synchonize thumbnails"
+msgstr "Activer les miniatures"
+
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
msgid "title"
msgstr "titre"
@@ -678,22 +682,18 @@ msgid "Theme"
msgstr "Thème"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:87
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:78
msgid "Language"
msgstr "Langue"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:116
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:102
msgid "Timezone"
msgstr "Fuseau horaire"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:103
msgid "Continent"
msgstr "Continent"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:117
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:103
msgid "City"
msgstr "Ville"
@@ -734,25 +734,21 @@ msgid "Do not show any links if the user is not logged in"
msgstr "N'afficher aucun lien sans être connecté"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:231
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:150
msgid "Check updates"
msgstr "Vérifier les mises à jour"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:232
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:152
msgid "Notify me when a new release is ready"
msgstr "Me notifier lorsqu'une nouvelle version est disponible"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:247
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:169
msgid "Enable REST API"
msgstr "Activer l'API REST"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:248
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:170
msgid "Allow third party software to use Shaarli such as mobile application"
msgstr ""
-"Permets aux applications tierces d'utiliser Shaarli, par exemple les "
+"Permet aux applications tierces d'utiliser Shaarli, par exemple les "
"applications mobiles"
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:263
@@ -763,30 +759,11 @@ msgstr "Clé d'API secrète"
msgid "Enable thumbnails"
msgstr "Activer les miniatures"
-#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:281
-msgid "You need to enable the extension php-gd
to use thumbnails."
-msgstr ""
-"Vous devez activer l'extension php-gd
pour utiliser les "
-"miniatures."
-
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:285
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:56
msgid "Synchronize thumbnails"
msgstr "Synchroniser les miniatures"
-#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:296
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:31
-msgid "All"
-msgstr "Tous"
-
-#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:300
-msgid "Only common media hosts"
-msgstr "Seulement les hébergeurs de média connus"
-
-#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:304
-msgid "None"
-msgstr "Aucune"
-
#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:312
#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
#: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139
@@ -847,107 +824,13 @@ msgid "Tags"
msgstr "Tags"
#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:57
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:167
msgid "Private"
msgstr "Privé"
#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
msgid "Apply Changes"
-msgstr "Appliquer"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-msgid "Export Database"
-msgstr "Exporter les données"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
-msgid "Selection"
-msgstr "Choisir"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
-msgid "Public"
-msgstr "Publics"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:52
-msgid "Prepend note permalinks with this Shaarli instance's URL"
-msgstr "Préfixer les liens de notes avec l'URL de l'instance de Shaarli"
-
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:53
-msgid "Useful to import bookmarks in a web browser"
-msgstr "Utile pour importer les marques-pages dans un navigateur"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-msgid "Import Database"
-msgstr "Importer des données"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:23
-msgid "Maximum size allowed:"
-msgstr "Taille maximum autorisée :"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
-msgid "Visibility"
-msgstr "Visibilité"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
-msgid "Use values from the imported file, default to public"
-msgstr ""
-"Utiliser les valeurs présentes dans le fichier d'import, public par défaut"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
-msgid "Import all bookmarks as private"
-msgstr "Importer tous les liens comme privés"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46
-msgid "Import all bookmarks as public"
-msgstr "Importer tous les liens comme publics"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:57
-msgid "Overwrite existing bookmarks"
-msgstr "Remplacer les liens existants"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:58
-msgid "Duplicates based on URL"
-msgstr "Les doublons s'appuient sur les URL"
-
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:72
-msgid "Add default tags"
-msgstr "Ajouter des tags par défaut"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
-msgid "Install Shaarli"
-msgstr "Installation de Shaarli"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:25
-msgid "It looks like it's the first time you run Shaarli. Please configure it."
-msgstr ""
-"Il semblerait que ça soit la première fois que vous lancez Shaarli. Merci de "
-"le configurer."
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:33
-#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:151
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:151
-msgid "Username"
-msgstr "Nom d'utilisateur"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
-#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:34
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:152
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:152
-msgid "Password"
-msgstr "Mot de passe"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:63
-msgid "Shaarli title"
-msgstr "Titre du Shaarli"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:69
-msgid "My links"
-msgstr "Mes liens"
-
-#: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:182
-msgid "Install"
-msgstr "Installer"
+msgstr "Appliquer les changements"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:79
@@ -964,13 +847,11 @@ msgstr[0] "lien privé"
msgstr[1] "liens privés"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:121
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:121
msgid "Search text"
msgstr "Recherche texte"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:37
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:128
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:128
#: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
#: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:64
@@ -1011,7 +892,6 @@ msgid "without any tag"
msgstr "sans tag"
#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:173
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:42
msgid "Fold"
msgstr "Replier"
@@ -1028,36 +908,36 @@ msgstr "permalien"
msgid "Add tag"
msgstr "Ajouter un tag"
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:7
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:183
+msgid "Toggle sticky"
+msgstr "Changer statut épinglé"
+
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:185
+msgid "Sticky"
+msgstr "Épinglé"
+
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:7
msgid "Filters"
msgstr "Filtres"
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:12
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:12
msgid "Only display private links"
msgstr "Afficher uniquement les liens privés"
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:15
msgid "Only display public links"
msgstr "Afficher uniquement les liens publics"
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:20
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:20
msgid "Filter untagged links"
msgstr "Filtrer par liens privés"
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:76
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:24
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:76
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:43
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:43
msgid "Fold all"
msgstr "Replier tout"
-#: tmp/linklist.paging.b91ef64efc3688266305ea9b42e5017e.rtpl.php:69
#: tmp/linklist.paging.cedf684561d925457130839629000a81.rtpl.php:69
msgid "Links per page"
msgstr "Liens par page"
@@ -1066,62 +946,59 @@ msgstr "Liens par page"
msgid ""
"You have been banned after too many failed login attempts. Try again later."
msgstr ""
-"Vous avez été banni après trop d'échec d'authentification. Merci de "
+"Vous avez été banni après trop d'échecs d'authentification. Merci de "
"réessayer plus tard."
+#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:30
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:151
+msgid "Username"
+msgstr "Nom d'utilisateur"
+
+#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:34
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:152
+msgid "Password"
+msgstr "Mot de passe"
+
#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:155
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:155
msgid "Remember me"
msgstr "Rester connecté"
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:14
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:48
msgid "by the Shaarli community"
msgstr "par la communauté Shaarli"
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:15
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:15
msgid "Documentation"
msgstr "Documentation"
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:44
msgid "Expand"
msgstr "Déplier"
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:45
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:45
msgid "Expand all"
msgstr "Déplier tout"
-#: tmp/page.footer.b91ef64efc3688266305ea9b42e5017e.rtpl.php:46
#: tmp/page.footer.cedf684561d925457130839629000a81.rtpl.php:46
msgid "Are you sure you want to delete this link?"
msgstr "Êtes-vous sûr de vouloir supprimer ce lien ?"
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:65
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:90
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:65
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:90
msgid "RSS Feed"
msgstr "Flux RSS"
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:70
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:106
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:70
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:106
msgid "Logout"
msgstr "Déconnexion"
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:173
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:173
msgid "is available"
msgstr "est disponible"
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:180
#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:180
msgid "Error"
msgstr "Erreur"
@@ -1221,22 +1098,18 @@ msgstr "tags"
msgid "List all links with those tags"
msgstr "Lister tous les liens avec ces tags"
-#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:3
#: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:3
msgid "Sort by:"
msgstr "Trier par :"
-#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:5
#: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:5
msgid "Cloud"
msgstr "Nuage"
-#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:6
#: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:6
msgid "Most used"
msgstr "Plus utilisés"
-#: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:7
#: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:7
msgid "Alphabetical"
msgstr "Alphabétique"
@@ -1251,7 +1124,7 @@ msgstr "Changer les paramètres de Shaarli : titre, fuseau horaire, etc."
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:17
msgid "Configure your Shaarli"
-msgstr "Conguration de Shaarli"
+msgstr "Configurer Shaarli"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:21
msgid "Enable, disable and configure plugins"
@@ -1259,31 +1132,39 @@ msgstr "Activer, désactiver et configurer les extensions"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
msgid "Change your password"
-msgstr "Modification du mot de passe"
+msgstr "Modifier le mot de passe"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:35
msgid "Rename or delete a tag in all links"
-msgstr "Rename or delete a tag in all links"
+msgstr "Renommer ou supprimer un tag dans tous les liens"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
+#, fuzzy
+#| msgid ""
+#| "Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, "
+#| "delicious…)"
msgid ""
"Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, "
"delicious...)"
msgstr ""
"Importer des marques pages au format Netscape HTML (comme exportés depuis "
-"Firefox, Chrome, Opera, delicious...)"
+"Firefox, Chrome, Opera, delicious…)"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
msgid "Import links"
msgstr "Importer des liens"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:47
+#, fuzzy
+#| msgid ""
+#| "Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, "
+#| "Opera, delicious…)"
msgid ""
"Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, "
"Opera, delicious...)"
msgstr ""
"Exporter les marques pages au format Netscape HTML (comme exportés depuis "
-"Firefox, Chrome, Opera, delicious...)"
+"Firefox, Chrome, Opera, delicious…)"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:48
msgid "Export database"
@@ -1298,13 +1179,13 @@ msgid ""
"Drag one of these button to your bookmarks toolbar or right-click it and "
"\"Bookmark This Link\""
msgstr ""
-"Glisser un de ces bouttons dans votre barre de favoris ou cliquer droit "
+"Glisser un de ces boutons dans votre barre de favoris ou cliquer droit "
"dessus et « Ajouter aux favoris »"
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:82
msgid "then click on the bookmarklet in any page you want to share."
msgstr ""
-"puis cliquer sur le marque page depuis un site que vous souhaitez partager."
+"puis cliquer sur le marque-page depuis un site que vous souhaitez partager."
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:86
#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:110
@@ -1339,33 +1220,16 @@ msgstr ""
msgid "Add Note"
msgstr "Ajouter une Note"
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139
-msgid ""
-"You need to browse your Shaarli over HTTPS to use this "
-"functionality."
-msgstr ""
-"Vous devez utiliser Shaarli en HTTPS pour utiliser cette "
-"fonctionalité."
-
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:144
-msgid "Add to"
-msgstr "Ajouter à"
-
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:155
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:136
msgid "3rd party"
msgstr "Applications tierces"
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:157
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:163
-msgid "Plugin"
-msgstr "Extension"
-
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:158
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:164
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:139
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:144
msgid "plugin"
msgstr "extension"
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:191
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:169
msgid ""
"Drag this link to your bookmarks toolbar, or right-click it and choose "
"Bookmark This Link"
@@ -1373,10 +1237,91 @@ msgstr ""
"Glisser ce lien dans votre barre de favoris ou cliquer droit dessus et « "
"Ajouter aux favoris »"
-#, fuzzy
-#~| msgid "Enable thumbnails"
-#~ msgid "Synchonize thumbnails"
-#~ msgstr "Activer les miniatures"
+#~ msgid "Sorry, nothing to see here."
+#~ msgstr "Désolé, il y a rien à voir ici."
+
+#~ msgid "Current password"
+#~ msgstr "Mot de passe actuel"
+
+#~ msgid "New password"
+#~ msgstr "Nouveau mot de passe"
+
+#~ msgid "Change"
+#~ msgstr "Changer"
+
+#~ msgid "Export Database"
+#~ msgstr "Exporter les données"
+
+#~ msgid "Selection"
+#~ msgstr "Choisir"
+
+#~ msgid "Public"
+#~ msgstr "Publics"
+
+#~ msgid "Prepend note permalinks with this Shaarli instance's URL"
+#~ msgstr "Préfixer les liens de note avec l'URL de l'instance de Shaarli"
+
+#~ msgid "Useful to import bookmarks in a web browser"
+#~ msgstr "Utile pour importer les marques-pages dans un navigateur"
+
+#~ msgid "Import Database"
+#~ msgstr "Importer des données"
+
+#~ msgid "Maximum size allowed:"
+#~ msgstr "Taille maximum autorisée :"
+
+#~ msgid "Visibility"
+#~ msgstr "Visibilité"
+
+#~ msgid "Use values from the imported file, default to public"
+#~ msgstr ""
+#~ "Utiliser les valeurs présentes dans le fichier d'import, public par défaut"
+
+#~ msgid "Import all bookmarks as private"
+#~ msgstr "Importer tous les liens comme privés"
+
+#~ msgid "Import all bookmarks as public"
+#~ msgstr "Importer tous les liens comme publics"
+
+#~ msgid "Overwrite existing bookmarks"
+#~ msgstr "Remplacer les liens existants"
+
+#~ msgid "Duplicates based on URL"
+#~ msgstr "Les doublons s'appuient sur les URL"
+
+#~ msgid "Add default tags"
+#~ msgstr "Ajouter des tags par défaut"
+
+#~ msgid "Install Shaarli"
+#~ msgstr "Installation de Shaarli"
+
+#~ msgid ""
+#~ "It looks like it's the first time you run Shaarli. Please configure it."
+#~ msgstr ""
+#~ "Il semblerait que ça soit la première fois que vous lancez Shaarli. Merci "
+#~ "de le configurer."
+
+#~ msgid "Shaarli title"
+#~ msgstr "Titre du Shaarli"
+
+#~ msgid "My links"
+#~ msgstr "Mes liens"
+
+#~ msgid "Install"
+#~ msgstr "Installer"
+
+#~ msgid ""
+#~ "You need to browse your Shaarli over HTTPS to use this "
+#~ "functionality."
+#~ msgstr ""
+#~ "Vous devez utiliser Shaarli en HTTPS pour utiliser cette "
+#~ "fonctionalité."
+
+#~ msgid "Add to"
+#~ msgstr "Ajouter à"
+
+#~ msgid "Plugin"
+#~ msgstr "Extension"
#~ msgid "Warning: "
#~ msgstr "Attention : "
@@ -1450,7 +1395,8 @@ msgstr ""
#~ "\n"
#~ msgid "Sessions do not seem to work correctly on your server."
-#~ msgstr "Les sessions ne semblent "
+#~ msgstr ""
+#~ "Les sessions ne semblent pas fonctionner correctement sur votre serveur."
#~ msgid "Tag was renamed in "
#~ msgstr "Le tag a été renommé dans "
diff --git a/index.php b/index.php
index 4b86a3e2..acfcc660 100644
--- a/index.php
+++ b/index.php
@@ -28,7 +28,7 @@
define('WEB_PATH', substr($_SERVER['REQUEST_URI'], 0, 1+strrpos($_SERVER['REQUEST_URI'], '/', 0)));
// High execution time in case of problematic imports/exports.
-ini_set('max_input_time','60');
+ini_set('max_input_time', '60');
// Try to set max upload file size and read
ini_set('memory_limit', '128M');
@@ -85,7 +85,7 @@
// Ensure the PHP version is supported
try {
ApplicationUtils::checkPHPVersion('5.5', PHP_VERSION);
-} catch(Exception $exc) {
+} catch (Exception $exc) {
header('Content-Type: text/plain; charset=utf-8');
echo $exc->getMessage();
exit;
@@ -111,7 +111,7 @@
session_name('shaarli');
// Start session if needed (Some server auto-start sessions).
-if (session_id() == '') {
+if (session_status() == PHP_SESSION_NONE) {
session_start();
}
@@ -223,7 +223,6 @@ function isLoggedIn()
$expirationTime,
WEB_PATH
);
-
} else {
// Standard session expiration (=when browser closes)
$expirationTime = 0;
@@ -257,7 +256,8 @@ function isLoggedIn()
exit;
}
}
- header('Location: ?'); exit;
+ header('Location: ?');
+ exit;
} else {
$loginManager->handleFailedLogin($_SERVER);
$redir = '&username='. urlencode($_POST['login']);
@@ -278,7 +278,9 @@ function isLoggedIn()
// ------------------------------------------------------------------------------------------
// Token management for XSRF protection
// Token should be used in any form which acts on data (create,update,delete,import...).
-if (!isset($_SESSION['tokens'])) $_SESSION['tokens']=array(); // Token are attached to the session.
+if (!isset($_SESSION['tokens'])) {
+ $_SESSION['tokens']=array(); // Token are attached to the session.
+}
/**
* Daily RSS feed: 1 RSS entry per day giving all the links on that day.
@@ -288,13 +290,14 @@ function isLoggedIn()
* @param ConfigManager $conf Configuration Manager instance
* @param LoginManager $loginManager LoginManager instance
*/
-function showDailyRSS($conf, $loginManager) {
+function showDailyRSS($conf, $loginManager)
+{
// Cache system
$query = $_SERVER['QUERY_STRING'];
$cache = new CachedPage(
$conf->get('config.PAGE_CACHE'),
page_url($_SERVER),
- startsWith($query,'do=dailyrss') && !$loginManager->isLoggedIn()
+ startsWith($query, 'do=dailyrss') && !$loginManager->isLoggedIn()
);
$cached = $cache->cachedVersion();
if (!empty($cached)) {
@@ -395,7 +398,7 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
{
$day = date('Ymd', strtotime('-1 day')); // Yesterday, in format YYYYMMDD.
if (isset($_GET['day'])) {
- $day = $_GET['day'];
+ $day = $_GET['day'];
}
$days = $LINKSDB->days();
@@ -413,7 +416,7 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
$previousday=$days[$i - 1];
}
if ($i < count($days) - 1) {
- $nextday = $days[$i + 1];
+ $nextday = $days[$i + 1];
}
}
try {
@@ -424,8 +427,8 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
}
// We pre-format some fields for proper output.
- foreach($linksToDisplay as $key => $link) {
- $taglist = explode(' ',$link['tags']);
+ foreach ($linksToDisplay as $key => $link) {
+ $taglist = explode(' ', $link['tags']);
uasort($taglist, 'strcasecmp');
$linksToDisplay[$key]['taglist']=$taglist;
$linksToDisplay[$key]['formatedDescription'] = format_description(
@@ -457,14 +460,14 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
*/
$columns = array(array(), array(), array()); // Entries to display, for each column.
$fill = array(0, 0, 0); // Rough estimate of columns fill.
- foreach($data['linksToDisplay'] as $key => $link) {
+ foreach ($data['linksToDisplay'] as $key => $link) {
// Roughly estimate length of entry (by counting characters)
// Title: 30 chars = 1 line. 1 line is 30 pixels height.
// Description: 836 characters gives roughly 342 pixel height.
// This is not perfect, but it's usually OK.
$length = strlen($link['title']) + (342 * strlen($link['description'])) / 836;
if ($link['thumbnail']) {
- $length += 100; // 1 thumbnails roughly takes 100 pixels height.
+ $length += 100; // 1 thumbnails roughly takes 100 pixels height.
}
// Then put in column which is the less filled:
$smallest = min($fill); // find smallest value in array.
@@ -492,8 +495,9 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
* @param ConfigManager $conf Configuration Manager instance.
* @param PluginManager $pluginManager Plugin Manager instance.
*/
-function showLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager) {
- buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager, $loginManager);
+function showLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
+{
+ buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager);
$PAGE->renderPage('linklist');
}
@@ -524,8 +528,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$updater->getDoneUpdates()
);
}
- }
- catch(Exception $e) {
+ } catch (Exception $e) {
die($e->getMessage());
}
@@ -538,8 +541,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$query = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : '';
$targetPage = Router::findPage($query, $_GET, $loginManager->isLoggedIn());
- if (
- // if the user isn't logged in
+ if (// if the user isn't logged in
!$loginManager->isLoggedIn() &&
// and Shaarli doesn't have public content...
$conf->get('privacy.hide_public_links') &&
@@ -563,9 +565,11 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
'footer',
);
- foreach($common_hooks as $name) {
+ foreach ($common_hooks as $name) {
$plugin_data = array();
- $pluginManager->executeHooks('render_' . $name, $plugin_data,
+ $pluginManager->executeHooks(
+ 'render_' . $name,
+ $plugin_data,
array(
'target' => $targetPage,
'loggedin' => $loginManager->isLoggedIn()
@@ -575,13 +579,15 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- Display login form.
- if ($targetPage == Router::$PAGE_LOGIN)
- {
- if ($conf->get('security.open_shaarli')) { header('Location: ?'); exit; } // No need to login for open Shaarli
+ if ($targetPage == Router::$PAGE_LOGIN) {
+ if ($conf->get('security.open_shaarli')) {
+ header('Location: ?');
+ exit;
+ } // No need to login for open Shaarli
if (isset($_GET['username'])) {
$PAGE->assign('username', escape($_GET['username']));
}
- $PAGE->assign('returnurl',(isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']):''));
+ $PAGE->assign('returnurl', (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']):''));
// add default state of the 'remember me' checkbox
$PAGE->assign('remember_user_default', $conf->get('privacy.remember_user_default'));
$PAGE->assign('user_can_login', $loginManager->canLogin($_SERVER));
@@ -590,8 +596,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
exit;
}
// -------- User wants to logout.
- if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=logout'))
- {
+ if (isset($_SERVER['QUERY_STRING']) && startsWith($_SERVER['QUERY_STRING'], 'do=logout')) {
invalidateCaches($conf->get('resource.page_cache'));
$sessionManager->logout();
setcookie(LoginManager::$STAY_SIGNED_IN_COOKIE, 'false', 0, WEB_PATH);
@@ -600,8 +605,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- Picture wall
- if ($targetPage == Router::$PAGE_PICWALL)
- {
+ if ($targetPage == Router::$PAGE_PICWALL) {
$PAGE->assign('pagetitle', t('Picture wall') .' - '. $conf->get('general.title', 'Shaarli'));
if (! $conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) === Thumbnailer::MODE_NONE) {
$PAGE->assign('linksToDisplay', []);
@@ -615,8 +619,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
// Get only links which have a thumbnail.
// Note: we do not retrieve thumbnails here, the request is too heavy.
- foreach($links as $key => $link)
- {
+ foreach ($links as $key => $link) {
if (isset($link['thumbnail']) && $link['thumbnail'] !== false) {
$linksToDisplay[] = $link; // Add to array.
}
@@ -637,8 +640,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- Tag cloud
- if ($targetPage == Router::$PAGE_TAGCLOUD)
- {
+ if ($targetPage == Router::$PAGE_TAGCLOUD) {
$visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
$filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : [];
$tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility);
@@ -653,7 +655,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
alphabetical_sort($tags, false, true);
$tagList = array();
- foreach($tags as $key => $value) {
+ foreach ($tags as $key => $value) {
if (in_array($key, $filteringTags)) {
continue;
}
@@ -685,8 +687,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- Tag list
- if ($targetPage == Router::$PAGE_TAGLIST)
- {
+ if ($targetPage == Router::$PAGE_TAGLIST) {
$visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : '';
$filteringTags = isset($_GET['searchtags']) ? explode(' ', $_GET['searchtags']) : [];
$tags = $LINKSDB->linksCountPerTag($filteringTags, $visibility);
@@ -732,7 +733,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$cache = new CachedPage(
$conf->get('resource.page_cache'),
page_url($_SERVER),
- startsWith($query,'do='. $targetPage) && !$loginManager->isLoggedIn()
+ startsWith($query, 'do='. $targetPage) && !$loginManager->isLoggedIn()
);
$cached = $cache->cachedVersion();
if (!empty($cached)) {
@@ -770,11 +771,14 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...)
- if (isset($_GET['addtag']))
- {
+ if (isset($_GET['addtag'])) {
// Get previous URL (http_referer) and add the tag to the searchtags parameters in query.
- if (empty($_SERVER['HTTP_REFERER'])) { header('Location: ?searchtags='.urlencode($_GET['addtag'])); exit; } // In case browser does not send HTTP_REFERER
- parse_str(parse_url($_SERVER['HTTP_REFERER'],PHP_URL_QUERY), $params);
+ if (empty($_SERVER['HTTP_REFERER'])) {
+ // In case browser does not send HTTP_REFERER
+ header('Location: ?searchtags='.urlencode($_GET['addtag']));
+ exit;
+ }
+ parse_str(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY), $params);
// Prevent redirection loop
if (isset($params['addtag'])) {
@@ -798,12 +802,14 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
// Append the tag if necessary
if (empty($params['searchtags'])) {
$params['searchtags'] = trim($_GET['addtag']);
- }
- elseif ($addtag) {
+ } elseif ($addtag) {
$params['searchtags'] = trim($params['searchtags']).' '.trim($_GET['addtag']);
}
- unset($params['page']); // We also remove page (keeping the same page has no sense, since the results are different)
+ // We also remove page (keeping the same page has no sense, since the
+ // results are different)
+ unset($params['page']);
+
header('Location: ?'.http_build_query($params));
exit;
}
@@ -828,13 +834,15 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$tags = explode(' ', $params['searchtags']);
// Remove value from array $tags.
$tags = array_diff($tags, array($_GET['removetag']));
- $params['searchtags'] = implode(' ',$tags);
+ $params['searchtags'] = implode(' ', $tags);
if (empty($params['searchtags'])) {
unset($params['searchtags']);
}
- unset($params['page']); // We also remove page (keeping the same page has no sense, since the results are different)
+ // We also remove page (keeping the same page has no sense, since
+ // the results are different)
+ unset($params['page']);
}
header('Location: ?'.http_build_query($params));
exit;
@@ -897,12 +905,10 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- Handle other actions allowed for non-logged in users:
- if (!$loginManager->isLoggedIn())
- {
+ if (!$loginManager->isLoggedIn()) {
// User tries to post new link but is not logged in:
// Show login screen, then redirect to ?post=...
- if (isset($_GET['post']))
- {
+ if (isset($_GET['post'])) {
header( // Redirect to login page, then back to post link.
'Location: ?do=login&post='.urlencode($_GET['post']).
(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').
@@ -925,8 +931,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
// -------- All other functions are reserved for the registered user:
// -------- Display the Tools menu if requested (import/export/bookmarklet...)
- if ($targetPage == Router::$PAGE_TOOLS)
- {
+ if ($targetPage == Router::$PAGE_TOOLS) {
$data = [
'pageabsaddr' => index_url($_SERVER),
'sslenabled' => is_https($_SERVER),
@@ -943,30 +948,40 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- User wants to change his/her password.
- if ($targetPage == Router::$PAGE_CHANGEPASSWORD)
- {
+ if ($targetPage == Router::$PAGE_CHANGEPASSWORD) {
if ($conf->get('security.open_shaarli')) {
die(t('You are not supposed to change a password on an Open Shaarli.'));
}
- if (!empty($_POST['setpassword']) && !empty($_POST['oldpassword']))
- {
- if (!$sessionManager->checkToken($_POST['token'])) die(t('Wrong token.')); // Go away!
+ if (!empty($_POST['setpassword']) && !empty($_POST['oldpassword'])) {
+ if (!$sessionManager->checkToken($_POST['token'])) {
+ die(t('Wrong token.')); // Go away!
+ }
// Make sure old password is correct.
- $oldhash = sha1($_POST['oldpassword'].$conf->get('credentials.login').$conf->get('credentials.salt'));
- if ($oldhash!= $conf->get('credentials.hash')) {
- echo '';
+ $oldhash = sha1(
+ $_POST['oldpassword'].$conf->get('credentials.login').$conf->get('credentials.salt')
+ );
+ if ($oldhash != $conf->get('credentials.hash')) {
+ echo '';
exit;
}
// Save new password
// Salt renders rainbow-tables attacks useless.
$conf->set('credentials.salt', sha1(uniqid('', true) .'_'. mt_rand()));
- $conf->set('credentials.hash', sha1($_POST['setpassword'] . $conf->get('credentials.login') . $conf->get('credentials.salt')));
+ $conf->set(
+ 'credentials.hash',
+ sha1(
+ $_POST['setpassword']
+ . $conf->get('credentials.login')
+ . $conf->get('credentials.salt')
+ )
+ );
try {
$conf->write($loginManager->isLoggedIn());
- }
- catch(Exception $e) {
+ } catch (Exception $e) {
error_log(
'ERROR while writing config file after changing password.' . PHP_EOL .
$e->getMessage()
@@ -978,9 +993,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
echo '';
exit;
- }
- else // show the change password form.
- {
+ } else {
+ // show the change password form.
$PAGE->assign('pagetitle', t('Change password') .' - '. $conf->get('general.title', 'Shaarli'));
$PAGE->renderPage('changepassword');
exit;
@@ -988,10 +1002,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- User wants to change configuration
- if ($targetPage == Router::$PAGE_CONFIGURE)
- {
- if (!empty($_POST['title']) )
- {
+ if ($targetPage == Router::$PAGE_CONFIGURE) {
+ if (!empty($_POST['title'])) {
if (!$sessionManager->checkToken($_POST['token'])) {
die(t('Wrong token.')); // Go away!
}
@@ -1019,7 +1031,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
&& $thumbnailsMode !== $conf->get('thumbnails.mode', Thumbnailer::MODE_NONE)
) {
$_SESSION['warnings'][] = t(
- 'You have enabled or changed thumbnails mode. Please synchronize them.'
+ 'You have enabled or changed thumbnails mode. '
+ .'Please synchronize them.'
);
}
$conf->set('thumbnails.mode', $thumbnailsMode);
@@ -1028,8 +1041,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$conf->write($loginManager->isLoggedIn());
$history->updateSettings();
invalidateCaches($conf->get('resource.page_cache'));
- }
- catch(Exception $e) {
+ } catch (Exception $e) {
error_log(
'ERROR while writing config file after configuration update.' . PHP_EOL .
$e->getMessage()
@@ -1041,9 +1053,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
echo '';
exit;
- }
- else // Show the configuration form.
- {
+ } else {
+ // Show the configuration form.
$PAGE->assign('title', $conf->get('general.title'));
$PAGE->assign('theme', $conf->get('resource.theme'));
$PAGE->assign('theme_available', ThemeUtils::getThemes($conf->get('resource.raintpl_tpl')));
@@ -1071,8 +1082,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- User wants to rename a tag or delete it
- if ($targetPage == Router::$PAGE_CHANGETAG)
- {
+ if ($targetPage == Router::$PAGE_CHANGETAG) {
if (empty($_POST['fromtag']) || (empty($_POST['totag']) && isset($_POST['renametag']))) {
$PAGE->assign('fromtag', ! empty($_GET['fromtag']) ? escape($_GET['fromtag']) : '');
$PAGE->assign('pagetitle', t('Manage tags') .' - '. $conf->get('general.title', 'Shaarli'));
@@ -1084,7 +1094,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
die(t('Wrong token.'));
}
- $alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), escape($_POST['totag']));
+ $toTag = isset($_POST['totag']) ? escape($_POST['totag']) : null;
+ $alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), $toTag);
$LINKSDB->save($conf->get('resource.page_cache'));
foreach ($alteredLinks as $link) {
$history->updateLink($link);
@@ -1100,16 +1111,14 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- User wants to add a link without using the bookmarklet: Show form.
- if ($targetPage == Router::$PAGE_ADDLINK)
- {
+ if ($targetPage == Router::$PAGE_ADDLINK) {
$PAGE->assign('pagetitle', t('Shaare a new link') .' - '. $conf->get('general.title', 'Shaarli'));
$PAGE->renderPage('addlink');
exit;
}
// -------- User clicked the "Save" button when editing a link: Save link to database.
- if (isset($_POST['save_edit']))
- {
+ if (isset($_POST['save_edit'])) {
// Go away!
if (! $sessionManager->checkToken($_POST['token'])) {
die(t('Wrong token.'));
@@ -1196,14 +1205,16 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- User clicked the "Cancel" button when editing a link.
- if (isset($_POST['cancel_edit']))
- {
+ if (isset($_POST['cancel_edit'])) {
$id = isset($_POST['lf_id']) ? (int) escape($_POST['lf_id']) : false;
if (! isset($LINKSDB[$id])) {
header('Location: ?');
}
// If we are called from the bookmarklet, we must close the popup:
- if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo ''; exit; }
+ if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) {
+ echo '';
+ exit;
+ }
$link = $LINKSDB[$id];
$returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
// Scroll to the link which has been edited.
@@ -1214,8 +1225,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- User clicked the "Delete" button when editing a link: Delete link from database.
- if ($targetPage == Router::$PAGE_DELETELINK)
- {
+ if ($targetPage == Router::$PAGE_DELETELINK) {
if (! $sessionManager->checkToken($_GET['token'])) {
die(t('Wrong token.'));
}
@@ -1229,28 +1239,31 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$ids = [$ids];
}
// assert at least one id is given
- if(!count($ids)){
+ if (!count($ids)) {
die('no id provided');
}
foreach ($ids as $id) {
$id = (int) escape($id);
$link = $LINKSDB[$id];
$pluginManager->executeHooks('delete_link', $link);
+ $history->deleteLink($link);
unset($LINKSDB[$id]);
}
$LINKSDB->save($conf->get('resource.page_cache')); // save to disk
- $history->deleteLink($link);
// If we are called from the bookmarklet, we must close the popup:
- if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo ''; exit; }
+ if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) {
+ echo '';
+ exit;
+ }
$location = '?';
if (isset($_SERVER['HTTP_REFERER'])) {
// Don't redirect to where we were previously if it was a permalink or an edit_link, because it would 404.
$location = generateLocation(
- $_SERVER['HTTP_REFERER'],
- $_SERVER['HTTP_HOST'],
- ['delete_link', 'edit_link', $link['shorturl']]
+ $_SERVER['HTTP_REFERER'],
+ $_SERVER['HTTP_HOST'],
+ ['delete_link', 'edit_link', $link['shorturl']]
);
}
@@ -1259,11 +1272,13 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
}
// -------- User clicked the "EDIT" button on a link: Display link edit form.
- if (isset($_GET['edit_link']))
- {
+ if (isset($_GET['edit_link'])) {
$id = (int) escape($_GET['edit_link']);
$link = $LINKSDB[$id]; // Read database
- if (!$link) { header('Location: ?'); exit; } // Link not found in database.
+ if (!$link) {
+ header('Location: ?');
+ exit;
+ } // Link not found in database.
$link['linkdate'] = $link['created']->format(LinkDB::LINK_DATE_FORMAT);
$data = array(
'link' => $link,
@@ -1289,8 +1304,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$link_is_new = false;
// Check if URL is not already in database (in this case, we will edit the existing link)
$link = $LINKSDB->getLinkFromUrl($url);
- if (! $link)
- {
+ if (! $link) {
$link_is_new = true;
$linkdate = strval(date(LinkDB::LINK_DATE_FORMAT));
// Get title if it was provided in URL (by the bookmarklet).
@@ -1299,7 +1313,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$description = empty($_GET['description']) ? '' : escape($_GET['description']);
$tags = empty($_GET['tags']) ? '' : escape($_GET['tags']);
$private = !empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0;
- // If this is an HTTP(S) link, we try go get the page to extract the title (otherwise we will to straight to the edit form.)
+
+ // If this is an HTTP(S) link, we try go get the page to extract
+ // the title (otherwise we will to straight to the edit form.)
if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) {
// Short timeout to keep the application responsive
// The callback will fill $charset and $title with data from the downloaded page.
@@ -1352,6 +1368,25 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
exit;
}
+ if ($targetPage == Router::$PAGE_PINLINK) {
+ if (! isset($_GET['id']) || empty($LINKSDB[$_GET['id']])) {
+ // FIXME! Use a proper error system.
+ $msg = t('Invalid link ID provided');
+ echo '';
+ exit;
+ }
+ if (! $sessionManager->checkToken($_GET['token'])) {
+ die('Wrong token.');
+ }
+
+ $link = $LINKSDB[$_GET['id']];
+ $link['sticky'] = ! $link['sticky'];
+ $LINKSDB[(int) $_GET['id']] = $link;
+ $LINKSDB->save($conf->get('resource.page_cache'));
+ header('Location: '.index_url($_SERVER));
+ exit;
+ }
+
if ($targetPage == Router::$PAGE_EXPORT) {
// Export links as a Netscape Bookmarks file
@@ -1388,7 +1423,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
header('Content-Type: text/html; charset=utf-8');
header(
'Content-disposition: attachment; filename=bookmarks_'
- .$selection.'_'.$now->format(LinkDB::LINK_DATE_FORMAT).'.html'
+ .$selection.'_'.$now->format(LinkDB::LINK_DATE_FORMAT).'.html'
);
$PAGE->assign('date', $now->format(DateTime::RFC822));
$PAGE->assign('eol', PHP_EOL);
@@ -1456,14 +1491,20 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
$pluginMeta = $pluginManager->getPluginsMeta();
// Split plugins into 2 arrays: ordered enabled plugins and disabled.
- $enabledPlugins = array_filter($pluginMeta, function($v) { return $v['order'] !== false; });
+ $enabledPlugins = array_filter($pluginMeta, function ($v) {
+ return $v['order'] !== false;
+ });
// Load parameters.
$enabledPlugins = load_plugin_parameter_values($enabledPlugins, $conf->get('plugins', array()));
uasort(
$enabledPlugins,
- function($a, $b) { return $a['order'] - $b['order']; }
+ function ($a, $b) {
+ return $a['order'] - $b['order'];
+ }
);
- $disabledPlugins = array_filter($pluginMeta, function($v) { return $v['order'] === false; });
+ $disabledPlugins = array_filter($pluginMeta, function ($v) {
+ return $v['order'] === false;
+ });
$PAGE->assign('enabledPlugins', $enabledPlugins);
$PAGE->assign('disabledPlugins', $disabledPlugins);
@@ -1480,21 +1521,23 @@ function($a, $b) { return $a['order'] - $b['order']; }
foreach ($_POST as $param => $value) {
$conf->set('plugins.'. $param, escape($value));
}
- }
- else {
+ } else {
$conf->set('general.enabled_plugins', save_plugin_config($_POST));
}
$conf->write($loginManager->isLoggedIn());
$history->updateSettings();
- }
- catch (Exception $e) {
+ } catch (Exception $e) {
error_log(
'ERROR while saving plugin configuration:.' . PHP_EOL .
$e->getMessage()
);
// TODO: do not handle exceptions/errors in JS.
- echo '';
+ echo '';
exit;
}
header('Location: ?do='. Router::$PAGE_PLUGINSADMIN);
@@ -1615,8 +1658,7 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager)
}
$linkDisp = array();
- while ($i<$end && $i
'.
@@ -1744,19 +1789,18 @@ function install($conf, $sessionManager, $loginManager) {
echo '
'. t('Click to try again.') .''));
$this->assertNotFalse(strpos($data['links'][0]['description'], '
lol #foo
<a href="?addtag=bar" title="Hashtag bar">#bar</a>http://link.tld
http://link.tld
http://link.tld #foobar
next #foo
link
link
-link