diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-01-12 19:50:48 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-02-15 20:30:24 +0100 |
commit | 510377d2cb4b12d1a421e8a88bd7edb86f223451 (patch) | |
tree | 6cea29c199fc1b29ccfb78f902313019f6f9d95e /application/LinkDB.php | |
parent | 268a2e52659964fb7d033a1bb4d1490bf8cc49bf (diff) | |
download | Shaarli-510377d2cb4b12d1a421e8a88bd7edb86f223451.tar.gz Shaarli-510377d2cb4b12d1a421e8a88bd7edb86f223451.tar.zst Shaarli-510377d2cb4b12d1a421e8a88bd7edb86f223451.zip |
Introduce the Updater class which
* contains methods designed to be run once.
* is able to upgrade the datastore or the configuration.
* is based on methods names, stored in a text file with ';' separator (updates.txt).
* begins with existing function 'mergeDeprecatedConfigFile()' (options.php).
Diffstat (limited to 'application/LinkDB.php')
-rw-r--r-- | application/LinkDB.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php index 19ca6435..a95b3f36 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php | |||
@@ -260,14 +260,11 @@ You use the community supported version of the original Shaarli project, by Seba | |||
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
263 | // Keep the list of the mapping URLs-->linkdate up-to-date. | ||
264 | $this->_urls = array(); | 263 | $this->_urls = array(); |
265 | foreach ($this->_links as $link) { | 264 | foreach ($this->_links as &$link) { |
265 | // Keep the list of the mapping URLs-->linkdate up-to-date. | ||
266 | $this->_urls[$link['url']] = $link['linkdate']; | 266 | $this->_urls[$link['url']] = $link['linkdate']; |
267 | } | 267 | // Sanitize data fields. |
268 | |||
269 | // Escape links data | ||
270 | foreach($this->_links as &$link) { | ||
271 | sanitizeLink($link); | 268 | sanitizeLink($link); |
272 | // Do not use the redirector for internal links (Shaarli note URL starting with a '?'). | 269 | // Do not use the redirector for internal links (Shaarli note URL starting with a '?'). |
273 | if (!empty($this->_redirector) && !startsWith($link['url'], '?')) { | 270 | if (!empty($this->_redirector) && !startsWith($link['url'], '?')) { |
@@ -381,6 +378,7 @@ You use the community supported version of the original Shaarli project, by Seba | |||
381 | } | 378 | } |
382 | $linkDays = array_keys($linkDays); | 379 | $linkDays = array_keys($linkDays); |
383 | sort($linkDays); | 380 | sort($linkDays); |
381 | |||
384 | return $linkDays; | 382 | return $linkDays; |
385 | } | 383 | } |
386 | } | 384 | } |