Fix downloading SQLite database from all users

This commit is contained in:
Thomas Citharel 2014-08-26 12:43:56 +02:00
parent 4362417495
commit 8763e4efde
4 changed files with 11 additions and 14 deletions

View file

@ -124,8 +124,6 @@ class Routing
} elseif (isset($_GET['import'])) { } elseif (isset($_GET['import'])) {
$import = $this->wallabag->import(); $import = $this->wallabag->import();
$tplVars = array_merge($this->vars, $import); $tplVars = array_merge($this->vars, $import);
} elseif (isset($_GET['download'])) {
Tools::downloadDb();
} elseif (isset($_GET['empty-cache'])) { } elseif (isset($_GET['empty-cache'])) {
Tools::emptyCache(); Tools::emptyCache();
} elseif (isset($_GET['export'])) { } elseif (isset($_GET['export'])) {

View file

@ -296,18 +296,20 @@ final class Tools
/** /**
* Download the sqlite database * 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'); // public static function downloadDb()
header('Content-Type: application/octet-stream'); // {
echo gzencode(file_get_contents(STORAGE_SQLITE)); // 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) * Get the content for a given URL (by a call to FullTextFeed)

View file

@ -121,8 +121,6 @@
<p><a href="?import">{% trans "You can click here to fetch content for articles with no content." %}</a></p> <p><a href="?import">{% trans "You can click here to fetch content for articles with no content." %}</a></p>
<h2>{% trans "Export your wallabag data" %}</h2> <h2>{% trans "Export your wallabag data" %}</h2>
{% if constant('STORAGE') == 'sqlite' %}
<p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %}
<p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
<h2>{% trans "Fancy an E-Book ?" %}</h2> <h2>{% trans "Fancy an E-Book ?" %}</h2>

View file

@ -121,7 +121,6 @@
<h2>{% trans "Export your wallabag data" %}</h2> <h2>{% trans "Export your wallabag data" %}</h2>
{% if constant('STORAGE') == 'sqlite' %} {% if constant('STORAGE') == 'sqlite' %}
<p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %}
<p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
<h2>{% trans "Cache" %}</h2> <h2>{% trans "Cache" %}</h2>