From 8763e4efde17f133d0bda504640acada108e7870 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 26 Aug 2014 12:43:56 +0200 Subject: [PATCH 1/2] Fix downloading SQLite database from all users --- inc/poche/Routing.class.php | 2 -- inc/poche/Tools.class.php | 20 +++++++++++--------- themes/baggy/config.twig | 2 -- themes/default/config.twig | 1 - 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index 004bd45..0b37305 100755 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@ -124,8 +124,6 @@ class Routing } elseif (isset($_GET['import'])) { $import = $this->wallabag->import(); $tplVars = array_merge($this->vars, $import); - } elseif (isset($_GET['download'])) { - Tools::downloadDb(); } elseif (isset($_GET['empty-cache'])) { Tools::emptyCache(); } elseif (isset($_GET['export'])) { diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 63137d7..c2c1bda 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -296,18 +296,20 @@ final class Tools /** * Download the sqlite database + * Function not longer used for security reasons */ - public static function downloadDb() - { - header('Content-Disposition: attachment; filename="poche.sqlite.gz"'); - self::_status(200); - header('Content-Transfer-Encoding: binary'); - header('Content-Type: application/octet-stream'); - echo gzencode(file_get_contents(STORAGE_SQLITE)); + // public static function downloadDb() + // { + // header('Content-Disposition: attachment; filename="poche.sqlite.gz"'); + // self::_status(200); - exit; - } + // header('Content-Transfer-Encoding: binary'); + // header('Content-Type: application/octet-stream'); + // echo gzencode(file_get_contents(STORAGE_SQLITE)); + + // exit; + // } /** * Get the content for a given URL (by a call to FullTextFeed) diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig index e45c321..7bd229c 100755 --- a/themes/baggy/config.twig +++ b/themes/baggy/config.twig @@ -121,8 +121,6 @@

{% trans "You can click here to fetch content for articles with no content." %}

{% trans "Export your wallabag data" %}

- {% if constant('STORAGE') == 'sqlite' %} -

{% trans "Click here" %} {% trans "to download your database." %}

{% endif %}

{% trans "Click here" %} {% trans "to export your wallabag data." %}

{% trans "Fancy an E-Book ?" %}

diff --git a/themes/default/config.twig b/themes/default/config.twig index 8f047ae..5656fad 100755 --- a/themes/default/config.twig +++ b/themes/default/config.twig @@ -121,7 +121,6 @@

{% trans "Export your wallabag data" %}

{% if constant('STORAGE') == 'sqlite' %} -

{% trans "Click here" %} {% trans "to download your database." %}

{% endif %}

{% trans "Click here" %} {% trans "to export your wallabag data." %}

{% trans "Cache" %}

From d5c481c2f40f1d05750a7020df1f129439627247 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 28 Aug 2014 21:01:43 +0200 Subject: [PATCH 2/2] remove old function --- inc/poche/Tools.class.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index c2c1bda..55fedac 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -294,23 +294,6 @@ final class Tools } } - /** - * Download the sqlite database - * Function not longer used for security reasons - */ - - // public static function downloadDb() - // { - // header('Content-Disposition: attachment; filename="poche.sqlite.gz"'); - // self::_status(200); - - // header('Content-Transfer-Encoding: binary'); - // header('Content-Type: application/octet-stream'); - // echo gzencode(file_get_contents(STORAGE_SQLITE)); - - // exit; - // } - /** * Get the content for a given URL (by a call to FullTextFeed) *