diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-03-21 21:40:49 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-03-25 19:17:59 +0100 |
commit | 528a6f8a232c060faf024008e4f8a09b4aa8dabc (patch) | |
tree | 86cac78b7f4d3998bedd923da83145c37ec88ff4 /application/Updater.php | |
parent | ee88a4bcc29da721cf43b750663aebeac4969517 (diff) | |
download | Shaarli-528a6f8a232c060faf024008e4f8a09b4aa8dabc.tar.gz Shaarli-528a6f8a232c060faf024008e4f8a09b4aa8dabc.tar.zst Shaarli-528a6f8a232c060faf024008e4f8a09b4aa8dabc.zip |
Refactor filter in LinkDB
* search type now carried by LinkDB in order to factorize code between different search sources.
* LinkDB->filter split in 3 method: filterSearch, filterHash, filterDay (we know what type of filter is needed).
* filterHash now throw a LinkNotFoundException if it doesn't exist: internal implementation choice, still displays a 404.
* Smallhash regex has been rewritten.
* Unit tests update
Diffstat (limited to 'application/Updater.php')
-rw-r--r-- | application/Updater.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/application/Updater.php b/application/Updater.php index 773a1ffa..58c13c07 100644 --- a/application/Updater.php +++ b/application/Updater.php | |||
@@ -137,7 +137,7 @@ class Updater | |||
137 | */ | 137 | */ |
138 | public function updateMethodRenameDashTags() | 138 | public function updateMethodRenameDashTags() |
139 | { | 139 | { |
140 | $linklist = $this->linkDB->filter(); | 140 | $linklist = $this->linkDB->filterSearch(); |
141 | foreach ($linklist as $link) { | 141 | foreach ($linklist as $link) { |
142 | $link['tags'] = preg_replace('/(^| )\-/', '$1', $link['tags']); | 142 | $link['tags'] = preg_replace('/(^| )\-/', '$1', $link['tags']); |
143 | $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true))); | 143 | $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true))); |