diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-01-20 22:51:56 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-01-20 22:51:56 +0100 |
commit | 55d0a5c445cbbd4fc322051b7753d0b2106cfe68 (patch) | |
tree | c76e2175f018b5966b192141cad2a31ae986234c /application/LinkDB.php | |
parent | 25d88c90aa74ea05162dfc59f47843df639beb75 (diff) | |
download | Shaarli-55d0a5c445cbbd4fc322051b7753d0b2106cfe68.tar.gz Shaarli-55d0a5c445cbbd4fc322051b7753d0b2106cfe68.tar.zst Shaarli-55d0a5c445cbbd4fc322051b7753d0b2106cfe68.zip |
Bugfix: prevent LinkFilter to work on outdated data.
Diffstat (limited to 'application/LinkDB.php')
-rw-r--r-- | application/LinkDB.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php index 16848519..19ca6435 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php | |||
@@ -63,11 +63,6 @@ class LinkDB implements Iterator, Countable, ArrayAccess | |||
63 | private $_redirector; | 63 | private $_redirector; |
64 | 64 | ||
65 | /** | 65 | /** |
66 | * @var LinkFilter instance. | ||
67 | */ | ||
68 | private $linkFilter; | ||
69 | |||
70 | /** | ||
71 | * Creates a new LinkDB | 66 | * Creates a new LinkDB |
72 | * | 67 | * |
73 | * Checks if the datastore exists; else, attempts to create a dummy one. | 68 | * Checks if the datastore exists; else, attempts to create a dummy one. |
@@ -85,7 +80,6 @@ class LinkDB implements Iterator, Countable, ArrayAccess | |||
85 | $this->_redirector = $redirector; | 80 | $this->_redirector = $redirector; |
86 | $this->_checkDB(); | 81 | $this->_checkDB(); |
87 | $this->_readDB(); | 82 | $this->_readDB(); |
88 | $this->linkFilter = new LinkFilter($this->_links); | ||
89 | } | 83 | } |
90 | 84 | ||
91 | /** | 85 | /** |
@@ -349,9 +343,11 @@ You use the community supported version of the original Shaarli project, by Seba | |||
349 | * | 343 | * |
350 | * @return array filtered links | 344 | * @return array filtered links |
351 | */ | 345 | */ |
352 | public function filter($type, $request, $casesensitive = false, $privateonly = false) { | 346 | public function filter($type, $request, $casesensitive = false, $privateonly = false) |
347 | { | ||
348 | $linkFilter = new LinkFilter($this->_links); | ||
353 | $requestFilter = is_array($request) ? implode(' ', $request) : $request; | 349 | $requestFilter = is_array($request) ? implode(' ', $request) : $request; |
354 | return $this->linkFilter->filter($type, trim($requestFilter), $casesensitive, $privateonly); | 350 | return $linkFilter->filter($type, trim($requestFilter), $casesensitive, $privateonly); |
355 | } | 351 | } |
356 | 352 | ||
357 | /** | 353 | /** |