From c80e6a5954b83c9be0d835b70e00985086fc53b8 Mon Sep 17 00:00:00 2001 From: Travis Miller Date: Tue, 22 Aug 2017 13:26:17 -0500 Subject: [PATCH] Fix serving existing files with encoded characters like `%20` --- commands/runserver/d7-rs-router.php | 2 +- commands/runserver/d8-rs-router.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/runserver/d7-rs-router.php b/commands/runserver/d7-rs-router.php index c82e05bfd2..26095de8b9 100644 --- a/commands/runserver/d7-rs-router.php +++ b/commands/runserver/d7-rs-router.php @@ -46,7 +46,7 @@ function runserver_env($key) { } $url = parse_url($_SERVER["REQUEST_URI"]); -if (file_exists('.' . $url['path'])) { +if (file_exists('.' . urldecode($url['path']))) { // Serve the requested resource as-is. return FALSE; } diff --git a/commands/runserver/d8-rs-router.php b/commands/runserver/d8-rs-router.php index d04d41d528..0b0a575cc0 100644 --- a/commands/runserver/d8-rs-router.php +++ b/commands/runserver/d8-rs-router.php @@ -46,7 +46,7 @@ function runserver_env($key) { } $url = parse_url($_SERVER["REQUEST_URI"]); -if (file_exists('.' . $url['path'])) { +if (file_exists('.' . urldecode($url['path']))) { // Serve the requested resource as-is. return FALSE; }