1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +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 <AK/URLParser.h>
#include <AK/LexicalPath.h>
#include <AK/StringBuilder.h>
#include <LibCore/DateTime.h>
@ -172,8 +173,7 @@ void Client::handle_directory_listing(const String& requested_path, const String
while (dt.has_next()) {
auto name = dt.next_path();
builder.append("<a href=\"");
// FIXME: urlencode
builder.append(name);
builder.append(urlencode(name));
builder.append("\">");
builder.append(escape_html_entities(name));
builder.append("</a>");