Skip to content

Commit 8fcda7e

Browse files
committed
Merge branch 'release/5.0.6' into v5
2 parents 6034c62 + 2ba3f53 commit 8fcda7e

32 files changed

+1412
-1393
lines changed

.github/workflows/code-analysis.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Code Analysis
22

33
on:
4-
pull_request: null
4+
pull_request:
5+
pull_request_review:
6+
types: [ submitted, edited ]
57
push:
68
branches:
79
- develop-v5

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Retour Changelog
22

3+
## 5.0.6 - 2025.01.27
4+
### Fixed
5+
* Fixed an issue where redirects were not, in fact, redirecting with the appropriate site URL prefix as expected ([#325](https://github.com/nystudio107/craft-retour/issues/325))
6+
37
## 5.0.5 - 2025.01.08
48
### Changed
59
* Fixed an issue where a GraphQL Retour query could return a URL with a `/` prefixed to it if the destination was a full URL ([#320](https://github.com/nystudio107/craft-retour/issues/320))

buildchain/package-lock.json

Lines changed: 124 additions & 124 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

buildchain/vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ export default defineConfig(({command}) => ({
6565
preserveSymlinks: true,
6666
},
6767
server: {
68+
// Allow cross-origin requests -- https://github.com/vitejs/vite/security/advisories/GHSA-vg6x-rcgg-rjx6
69+
allowedHosts: true,
70+
cors: true,
6871
fs: {
6972
strict: false
7073
},
74+
headers: {
75+
"Access-Control-Allow-Private-Network": "true",
76+
},
7177
host: '0.0.0.0',
7278
origin: 'http://localhost:' + process.env.DEV_PORT,
7379
port: parseInt(process.env.DEV_PORT),

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nystudio107/craft-retour",
33
"description": "Retour allows you to intelligently redirect legacy URLs, so that you don't lose SEO value when rebuilding & restructuring a website",
44
"type": "craft-plugin",
5-
"version": "5.0.5",
5+
"version": "5.0.6",
66
"keywords": [
77
"craftcms",
88
"craft-plugin",
@@ -56,6 +56,10 @@
5656
"yiisoft/yii2-composer": true
5757
},
5858
"optimize-autoloader": true,
59+
"platform": {
60+
"php": "8.2"
61+
},
62+
"platform-check": false,
5963
"sort-packages": true
6064
},
6165
"autoload": {

docs/package-lock.json

Lines changed: 330 additions & 393 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gql/resolvers/RetourResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static function resolve(mixed $source, array $arguments, mixed $context,
8181
$path = $redirect['redirectDestUrl'];
8282
// Combine the URL and path together, merging them as appropriate
8383
try {
84-
if (!UrlHelper::isFullUrl($dest) && !UrlHelper::pathHasSitePrefix($path)) {
84+
if (!UrlHelper::isAbsoluteUrl($dest) && !UrlHelper::pathHasSitePrefix($path)) {
8585
$dest = UrlHelper::siteUrl('/', null, null, $siteId);
8686
$dest = UrlHelper::mergeUrlWithPath($dest, $path);
8787
$dest = parse_url($dest, PHP_URL_PATH);

src/helpers/UrlHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public static function pathHasSitePrefix(string $path): bool
9292
// Normalizes a URI path by trimming leading/ trailing slashes and removing double slashes
9393
$sitePath = '/' . preg_replace('/\/\/+/', '/', trim($sitePath, '/'));
9494
}
95-
// Strip the $sitePath from the incoming $path
96-
if (str_starts_with($path, $sitePath)) {
95+
// See if the path begins with a site path prefix
96+
if ($sitePath !== '/' && str_starts_with($path, $sitePath)) {
9797
return true;
9898
}
9999
}

src/services/Redirects.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ public function doRedirect(string $fullUrl, string $pathOnly, ?array $redirect):
829829
if ($siteId !== null) {
830830
$siteId = (int)$siteId;
831831
}
832-
if (!UrlHelper::isFullUrl($dest) && !UrlHelper::pathHasSitePrefix($path)) {
832+
if (!UrlHelper::isAbsoluteUrl($dest) && !UrlHelper::pathHasSitePrefix($path)) {
833833
$dest = UrlHelper::siteUrl('/', null, null, $siteId);
834834
$dest = UrlHelper::mergeUrlWithPath($dest, $path);
835835
$dest = parse_url($dest, PHP_URL_PATH);

src/web/assets/dist/assets/dashboard-CxTeoLAH.js renamed to src/web/assets/dist/assets/dashboard-BLlHxo8E.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)