From 985ce3ec53a71174b30b1872813cb69cab8d7081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 25 Oct 2013 14:25:37 +0200 Subject: bug fix #259: Deleting article doesn't redirect --- inc/poche/Poche.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 0766cd51..39d43761 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -374,7 +374,7 @@ class Poche $msg = 'error : can\'t delete link #' . $id; } Tools::logm($msg); - Tools::redirect(); + Tools::redirect('?'); break; case 'toggle_fav' : $this->store->favoriteById($id, $this->user->getId()); -- cgit v1.2.3 From 363bc4eb8642d464cc0c099f7ab72a425b56b463 Mon Sep 17 00:00:00 2001 From: banux Date: Sun, 27 Oct 2013 07:37:05 +0100 Subject: Add a autoclose parameters. When we use sharing method in plugins like the tiny tiny rss one or the firefox plugins we can passe the autoclose=true parameters that close the popup. --- inc/poche/Poche.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 39d43761..5d807268 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -327,7 +327,7 @@ class Poche /** * Call action (mark as fav, archive, delete, etc.) */ - public function action($action, Url $url, $id = 0, $import = FALSE) + public function action($action, Url $url, $id = 0, $import = FALSE, $autoclose = FALSE) { switch ($action) { @@ -358,7 +358,11 @@ class Poche } if (!$import) { - Tools::redirect('?view=home'); + if ($autoclose == TRUE) { + Tools::redirect('?view=home'); + } else { + Tools::redirect('?view=home&autoclose=true'); + } } break; case 'delete': -- cgit v1.2.3 From f616ab60efc502b919b9b72f81aee2975b2e8465 Mon Sep 17 00:00:00 2001 From: banux Date: Sun, 27 Oct 2013 07:47:14 +0100 Subject: use 2 seprate variable for autoclosing windows to avoid to quick closing when sharing, the popup can be close before the link is save --- inc/poche/Poche.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5d807268..3ecaf084 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -361,7 +361,7 @@ class Poche if ($autoclose == TRUE) { Tools::redirect('?view=home'); } else { - Tools::redirect('?view=home&autoclose=true'); + Tools::redirect('?view=home&closewin=true'); } } break; -- cgit v1.2.3 From 45e9e0f5653993d5f463209691953e7a41527267 Mon Sep 17 00:00:00 2001 From: Dmitry Sandalov Date: Tue, 5 Nov 2013 12:13:55 +0300 Subject: fix #270 access from remote machine Replacing SERVER_NAME with HTTP_HOST allows me to use Poche on remote machines --- inc/poche/Tools.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/poche') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 1d092823..030d75ba 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -53,12 +53,12 @@ class Tools $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]); - if (!isset($_SERVER["SERVER_NAME"])) { + if (!isset($_SERVER["HTTP_HOST"])) { return $scriptname; } return 'http' . ($https ? 's' : '') . '://' - . $_SERVER["SERVER_NAME"] . $serverport . $scriptname; + . $_SERVER["HTTP_HOST"] . $serverport . $scriptname; } public static function redirect($url = '') -- cgit v1.2.3 From f2d3ee98a6a3137f8c3edd62294d34a8ff4700b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 13 Nov 2013 15:17:34 +0100 Subject: [fix] bug fix #287: test if open_basedir & safe_mode are active to use CURLOPT_FOLLOWLOCATION --- inc/poche/Tools.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 1d092823..7a872e7d 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -133,7 +133,9 @@ class Tools $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_TIMEOUT, $timeout); - curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + if (!ini_get('open_basedir') && !ini_get('safe_mode')) { + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + } curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); -- cgit v1.2.3 From 0c2f453750b742fde21ec2a8fdcf3beb9eff2faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 20 Nov 2013 10:22:21 +0100 Subject: Fix Undefined offset Notice (thx @vjousse) --- inc/poche/Database.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/poche') diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 1d3ff0c2..bf67de2a 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -166,7 +166,7 @@ class Database { $query = $this->executeQuery($sql, $params); $entry = $query->fetchAll(); - return $entry[0]; + return isset($entry[0]) ? $entry[0] : null; } public function getEntriesByView($view, $user_id, $limit = '') { -- cgit v1.2.3