-
Notifications
You must be signed in to change notification settings - Fork 214
Openverse: Strip only the leading subpath when building the redirect target. #852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
mcliwanow
wants to merge
14
commits into
WordPress:trunk
from
mcliwanow:openverse-redirect-subpath-strip
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c3f8c30
Openverse: Strip only the leading subpath when building the redirect …
mcliwanow 6a4c65b
Openverse: Match the subpath as a whole segment and validate before r…
mcliwanow 626501d
Merge branch 'trunk' into openverse-redirect-subpath-strip
mcliwanow b20e54e
Openverse: Require an absolute target before redirecting.
mcliwanow 61c67ed
Openverse: Require an http or https scheme on the redirect target.
mcliwanow dd9b194
Merge branch 'trunk' into openverse-redirect-subpath-strip
mcliwanow cdc87b4
Openverse: Add a test suite for the redirect target.
mcliwanow 5f43f8c
Openverse: Read the redirect switch and the origin as they were written.
mcliwanow ec519ee
Openverse: Compare the target's host with the configured origin.
mcliwanow c3520da
Openverse: Use pl_PL in the locale test.
mcliwanow 217b5ce
Openverse: Yoda condition in the target host comparison.
mcliwanow 676c5ce
Merge branch 'trunk' into openverse-redirect-subpath-strip
mcliwanow 715c71e
Openverse: Accept an upper-case scheme on the configured origin.
mcliwanow c6c8833
Merge branch 'trunk' into openverse-redirect-subpath-strip
mcliwanow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "core": "WordPress/WordPress#master", | ||
| "phpVersion": "8.4", | ||
| "testsEnvironment": false, | ||
| "plugins": [], | ||
| "themes": [ | ||
| "../wordpress.org/public_html/wp-content/themes/pub/wporg-openverse" | ||
| ], | ||
| "lifecycleScripts": { | ||
| "afterStart": "bash openverse/bin/after-start-test.sh" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Runs after wp-env start for the test environment. | ||
| # Installs PHPUnit 11 and Yoast polyfills in the test container. | ||
| # | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| CONFIG="--config openverse/.wp-env.test.json" | ||
| RUN="npx wp-env $CONFIG run cli" | ||
|
|
||
| echo "Installing PHPUnit 11 and polyfills..." | ||
| $RUN composer global require -W phpunit/phpunit:^11.0 2>&1 | ||
| $RUN composer require --dev yoast/phpunit-polyfills:^4.0 --working-dir=/wordpress-phpunit 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
wordpress.org/public_html/wp-content/themes/pub/wporg-openverse/phpunit.xml.dist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <phpunit | ||
| bootstrap="tests/bootstrap.php" | ||
| backupGlobals="false" | ||
| colors="true" | ||
| > | ||
| <testsuites> | ||
| <testsuite name="wporg-openverse"> | ||
| <directory suffix=".php">tests/</directory> | ||
| <exclude>tests/bootstrap.php</exclude> | ||
| <exclude>tests/locales-stub.php</exclude> | ||
| </testsuite> | ||
| </testsuites> | ||
| </phpunit> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.