From 65012d34ee94cf840f73951aa1ec8a193800e306 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 19 Aug 2019 11:27:11 +0200 Subject: [PATCH 1/3] use python3 --- pandora/manage.py | 2 +- update.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/manage.py b/pandora/manage.py index d33da6f9..700a1802 100755 --- a/pandora/manage.py +++ b/pandora/manage.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import signal import sys diff --git a/update.py b/update.py index 119f9adb..0e6c04de 100755 --- a/update.py +++ b/update.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import json import os From c5d481ee78161e6951d1741e2eea3b0fb9aef258 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 19 Aug 2019 22:28:35 +0200 Subject: [PATCH 2/3] move client_max_body_size --- etc/nginx/pandora | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/nginx/pandora b/etc/nginx/pandora index 8ef1f433..419120aa 100644 --- a/etc/nginx/pandora +++ b/etc/nginx/pandora @@ -55,11 +55,11 @@ server { proxy_buffering off; proxy_read_timeout 90; #should be in sync with gunicorn timeout proxy_connect_timeout 90; #should be in sync with gunicorn timeout + client_max_body_size 32m; if (!-f $request_filename) { proxy_pass http://127.0.0.1:2620; break; } - client_max_body_size 32m; } error_page 400 /; From 1d5fdf35ec828a775221f2bd93519307607b9fb9 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 19 Aug 2019 22:28:52 +0200 Subject: [PATCH 3/3] # in pdf name not working --- static/js/document.js | 2 +- static/js/documentDialog.js | 2 +- static/js/utils.js | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/static/js/document.js b/static/js/document.js index 6d1b2567..a13332d2 100644 --- a/static/js/document.js +++ b/static/js/document.js @@ -66,7 +66,7 @@ pandora.ui.document = function() { ? pandora.user.ui.documents[item.id].position : 1, url: '/documents/' + item.id + '/' - + item.title.replace('?', '_') + '.' + item.extension, + + pandora.safePDFName(item.title + '.' + item.extension), width: that.width(), zoom: 'fit' }) diff --git a/static/js/documentDialog.js b/static/js/documentDialog.js index a8d1d581..b2c17308 100644 --- a/static/js/documentDialog.js +++ b/static/js/documentDialog.js @@ -196,7 +196,7 @@ pandora.ui.documentDialog = function(options) { ? pandora.user.ui.documents[item.id].position : 1, url: '/documents/' + item.id + '/' - + item.title.replace('?', '_') + '.' + item.extension, + + pandora.safePDFName(item.title + '.' + item.extension), width: dialogWidth, zoom: 'fit' }) diff --git a/static/js/utils.js b/static/js/utils.js index 7f80064d..3ce86c15 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -2625,6 +2625,11 @@ pandora.openURL = function(url) { } }; +pandora.safePDFName = function(name) { + name = name.replace('?', '_').replace('#', '_'); + return name; +}; + pandora.saveURL = function(url, name) { var link = document.createElement('a'); if (typeof link.download === 'string') {