From: nodiscc Date: Tue, 23 Jun 2015 12:57:54 +0000 (+0200) Subject: re-add readDb() missing from previous merge X-Git-Tag: v0.5.0~36 X-Git-Url: https://git.immae.eu/?p=github%2Fshaarli%2FShaarli.git;a=commitdiff_plain;h=578a84bda0679720f21271ef34de58106c0646fe re-add readDb() missing from previous merge --- diff --git a/application/LinkDB.php b/application/LinkDB.php index 388002f6..137f42e5 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php @@ -208,6 +208,13 @@ class LinkDB implements Iterator, Countable, ArrayAccess */ private function readdb() { + + // Public links are hidden and user not logged in => nothing to show + if ($GLOBALS['config']['HIDE_PUBLIC_LINKS'] && !isLoggedIn()) { + $this->links = array(); + return; + } + // Read data // Note that gzinflate is faster than gzuncompress. // See: http://www.php.net/manual/en/function.gzdeflate.php#96439