mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-09 01:44:56 -04:00
Revert "Replaced sanitize_html() function that was based on regex with python3's html.escape()"
This reverts commit a24b4a7762
.
This commit is contained in:
parent
bb80efa00f
commit
c52bb03dc6
1 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ GNU General Public License for more details.
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
import queue, mimetypes, platform, os, sys, socket, logging, html
|
import queue, mimetypes, platform, os, sys, socket, logging, re
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
from flask import Flask, Response, request, render_template_string, abort
|
from flask import Flask, Response, request, render_template_string, abort
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ def set_file_info(filenames, processed_size_callback=None):
|
||||||
file_info = {'files': [], 'dirs': []}
|
file_info = {'files': [], 'dirs': []}
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
# strips trailing '/' and sanitizes filename
|
# strips trailing '/' and sanitizes filename
|
||||||
basename = html.escape(os.path.basename(filename.rstrip('/')))
|
basename = sanitize_html(os.path.basename(filename.rstrip('/')))
|
||||||
info = {
|
info = {
|
||||||
'filename': filename,
|
'filename': filename,
|
||||||
'basename': basename
|
'basename': basename
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue