1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

WebServer: Use urlencode() in directory listings

This commit is contained in:
Andreas Kling 2020-07-27 19:28:15 +02:00
parent a2b40de0cc
commit efa117f801

View file

@ -25,6 +25,7 @@
*/ */
#include "Client.h" #include "Client.h"
#include <AK/URLParser.h>
#include <AK/LexicalPath.h> #include <AK/LexicalPath.h>
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibCore/DateTime.h> #include <LibCore/DateTime.h>
@ -172,8 +173,7 @@ void Client::handle_directory_listing(const String& requested_path, const String
while (dt.has_next()) { while (dt.has_next()) {
auto name = dt.next_path(); auto name = dt.next_path();
builder.append("<a href=\""); builder.append("<a href=\"");
// FIXME: urlencode builder.append(urlencode(name));
builder.append(name);
builder.append("\">"); builder.append("\">");
builder.append(escape_html_entities(name)); builder.append(escape_html_entities(name));
builder.append("</a>"); builder.append("</a>");