From e7a8308067ba6b36444f013c9aa8b08925287f6e Mon Sep 17 00:00:00 2001 From: Brandon Payton Date: Mon, 19 Aug 2024 17:42:33 -0400 Subject: [PATCH 1/4] Stop using deprecated string interpolation syntax --- .../playground/website-deployment/custom-redirects-lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/playground/website-deployment/custom-redirects-lib.php b/packages/playground/website-deployment/custom-redirects-lib.php index b86f89f833..25886dcbc7 100644 --- a/packages/playground/website-deployment/custom-redirects-lib.php +++ b/packages/playground/website-deployment/custom-redirects-lib.php @@ -23,7 +23,7 @@ function playground_handle_request() { ? function ( $str ) { error_log( "PLAYGROUND: $str" ); } : function () {}; - $log( "Handling request for '${_SERVER['REQUEST_URI']}'" ); + $log( "Handling request for '{$_SERVER['REQUEST_URI']}'" ); $url = parse_url( $_SERVER['REQUEST_URI'] ); if ( false === $url ) { @@ -70,8 +70,8 @@ function playground_handle_request() { } if ( $should_redirect ) { - $log( "Redirecting to '${redirect['location']}' with status '${redirect['status']}'" ); - header( "Location: ${redirect['location']}" ); + $log( "Redirecting to '{$redirect['location']}' with status '{$redirect['status']}'" ); + header( "Location: {$redirect['location']}" ); http_response_code( $redirect['status'] ); die(); } From dd14d809df303368c9317bbf5a549a05b6c8b50a Mon Sep 17 00:00:00 2001 From: Brandon Payton Date: Mon, 19 Aug 2024 18:32:38 -0400 Subject: [PATCH 2/4] Fix website redirect for /builder --- .../website-deployment/custom-redirects-lib.php | 7 ++++++- packages/playground/website/builder/index.php | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 packages/playground/website/builder/index.php diff --git a/packages/playground/website-deployment/custom-redirects-lib.php b/packages/playground/website-deployment/custom-redirects-lib.php index 25886dcbc7..cf62d91f62 100644 --- a/packages/playground/website-deployment/custom-redirects-lib.php +++ b/packages/playground/website-deployment/custom-redirects-lib.php @@ -188,7 +188,12 @@ function playground_maybe_redirect( $requested_path ) { ); } - if ( str_ends_with( $requested_path, '/builder' ) ) { + if ( + // Since `/builder/` is an actual directory, + // nginx redirects requests for `/builder` to `/builder/`. + str_ends_with( $requested_path, '/builder/' ) || + str_ends_with( $requested_path, '/builder/index.php' ) + ) { return array( 'location' => 'https://playground.wordpress.net/builder/builder.html', 'status' => 301 diff --git a/packages/playground/website/builder/index.php b/packages/playground/website/builder/index.php new file mode 100644 index 0000000000..0ac86f20fc --- /dev/null +++ b/packages/playground/website/builder/index.php @@ -0,0 +1,16 @@ + + + + + Navigate to the Blueprint Builder + + + + + Navigate to the Blueprint Builder. + + \ No newline at end of file From a9f4fbbb901ed4ed26efd1b27dfe2d296c35af17 Mon Sep 17 00:00:00 2001 From: Brandon Payton Date: Mon, 19 Aug 2024 18:43:08 -0400 Subject: [PATCH 3/4] Add blank line to end of new index.php --- packages/playground/website/builder/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playground/website/builder/index.php b/packages/playground/website/builder/index.php index 0ac86f20fc..eb4a311554 100644 --- a/packages/playground/website/builder/index.php +++ b/packages/playground/website/builder/index.php @@ -13,4 +13,4 @@ Navigate to the Blueprint Builder. - \ No newline at end of file + From b0fbc80d1001329c9cc14e450d8e6f760eded895 Mon Sep 17 00:00:00 2001 From: Brandon Payton Date: Mon, 19 Aug 2024 18:47:33 -0400 Subject: [PATCH 4/4] Explain why /builder/index.php exists --- packages/playground/website/builder/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/playground/website/builder/index.php b/packages/playground/website/builder/index.php index eb4a311554..c036833242 100644 --- a/packages/playground/website/builder/index.php +++ b/packages/playground/website/builder/index.php @@ -1,3 +1,9 @@ +