aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-02-01 12:22:14 +0100
committerThomas Citharel <tcit@tcit.fr>2015-02-01 12:22:14 +0100
commit89637c2a1dcc114b17a8f7eef493b51315e1a6ac (patch)
tree1715cb08f5b754f320c32c2612775fbe811b2d92 /inc/poche
parentd4b6e20e2f04c5e93ab77b732a1108aee1b639d6 (diff)
downloadwallabag-89637c2a1dcc114b17a8f7eef493b51315e1a6ac.tar.gz
wallabag-89637c2a1dcc114b17a8f7eef493b51315e1a6ac.tar.zst
wallabag-89637c2a1dcc114b17a8f7eef493b51315e1a6ac.zip
added reload icon and fixed a bug where random could redirect to deleted articles
Diffstat (limited to 'inc/poche')
-rwxr-xr-xinc/poche/Poche.class.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index fb74ab9a..f9928145 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -349,8 +349,11 @@ class Poche
349 349
350 /* For some unknown reason I can't get displayView() to work here (it redirects to home view afterwards). So here's a dirty fix which redirects directly to URL */ 350 /* For some unknown reason I can't get displayView() to work here (it redirects to home view afterwards). So here's a dirty fix which redirects directly to URL */
351 case 'random': 351 case 'random':
352 $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); 352 $id = 0;
353 $id = rand(1,$count); 353 while ($this->store->retrieveOneById($id,$this->user->getId()) == null) {
354 $count = $this->store->getEntriesByViewCount($view, $this->user->getId());
355 $id = rand(1,$count);
356 }
354 Tools::logm('get a random article'); 357 Tools::logm('get a random article');
355 Tools::redirect('?view=view&id=' . $id); 358 Tools::redirect('?view=view&id=' . $id);
356 //$this->displayView('view', $id); 359 //$this->displayView('view', $id);