diff --git a/README.md b/README.md index bdbfb9c..66f6219 100644 --- a/README.md +++ b/README.md @@ -107,9 +107,10 @@ Project maintained on GitHub at [automattic/wordpress-activitypub](https://githu ### Next ### -* Compatibility: allow deactivating blocks registered by the plugin. -* Compatibility: avoid Fatal Errors when using ClassicPress. -* Fixed: fix a typo in a hook name. +* Compatibility: allow deactivating blocks registered by the plugin +* Compatibility: avoid Fatal Errors when using ClassicPress +* Fixed: fix a typo in a hook name +* Fixed: a problem with signatures when running WordPress in a sub-path ### 1.0.0 ### diff --git a/includes/class-signature.php b/includes/class-signature.php index 1b29d4c..10cbf39 100644 --- a/includes/class-signature.php +++ b/includes/class-signature.php @@ -238,6 +238,15 @@ class Signature { } else { $route = '/' . rest_get_url_prefix() . '/' . ltrim( $request->get_route(), '/' ); } + + // fix route for subdirectory installs + $path = wp_parse_url( get_home_url(), PHP_URL_PATH ); + $path = trim( $path, '/' ); + + if ( $path ) { + $route = '/' . $path . $route; + } + $headers = $request->get_headers(); $headers['(request-target)'][0] = strtolower( $request->get_method() ) . ' ' . $route; } else { diff --git a/readme.txt b/readme.txt index 9f1fed6..f9303c3 100644 --- a/readme.txt +++ b/readme.txt @@ -107,9 +107,10 @@ Project maintained on GitHub at [automattic/wordpress-activitypub](https://githu = Next = -* Compatibility: allow deactivating blocks registered by the plugin. -* Compatibility: avoid Fatal Errors when using ClassicPress. -* Fixed: fix a typo in a hook name. +* Compatibility: allow deactivating blocks registered by the plugin +* Compatibility: avoid Fatal Errors when using ClassicPress +* Fixed: fix a typo in a hook name +* Fixed: a problem with signatures when running WordPress in a sub-path = 1.0.0 =