Skip to content
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

KSES: allow port numbers in pdf object url #1998

Closed
wants to merge 15 commits into from
Closed

KSES: allow port numbers in pdf object url #1998

wants to merge 15 commits into from

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Dec 2, 2021

This patch tests a way to cater for port numbers in pdf $url argument.
Renaming $value to $url to match PHP doc comment.

See comment https://core.trac.wordpress.org/ticket/54261#comment:15

Trac ticket: https://core.trac.wordpress.org/ticket/54261


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Testing a way to cater for port numbers in pdf $url argument.
Renaming $value to $url to match PHP doc comment.
Adding tests
tests/phpunit/tests/kses.php Outdated Show resolved Hide resolved
@ramonjd ramonjd changed the title [WIP] KSES: allow port numbers in pdf object url KSES: allow port numbers in pdf object url Dec 2, 2021
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few notes, two of which are nitpicks.

tests/phpunit/tests/kses.php Outdated Show resolved Hide resolved
tests/phpunit/tests/kses.php Show resolved Hide resolved
tests/phpunit/tests/kses.php Outdated Show resolved Hide resolved
tests/phpunit/tests/kses.php Outdated Show resolved Hide resolved
@ramonjd
Copy link
Member Author

ramonjd commented Dec 3, 2021

Tests are passing now 😄

Are there any further tests required for this change (assuming the change itself is sound)?

@peterwilsoncc
Copy link
Contributor

It'd be good to put some unhappy paths in to make sure they fail with the ports too, for example example.org should be removed if the upload url is example.org:8888

I don't think the new test will need as many scenarios as the other data provider as it covers most of the unrelated to port unhappy paths.

According to the WordPress Slack, your on vacation at the moment so I can look in to that and push to your repo if you do not mind.

@ramonjd
Copy link
Member Author

ramonjd commented Dec 3, 2021

It'd be good to put some unhappy paths in to make sure they fail with the ports too, for example example.org should be removed if the upload url is example.org:8888

Great call. I've added a couple more, but feel free to edit/delete/change as you like.

According to the WordPress Slack, your on vacation at the moment so I can look in to that and push to your repo if you do not mind.

Hah, I'm mostly around. Thanks for offering!! I just like trees 🌴

@peterwilsoncc
Copy link
Contributor

ockham added a commit to WordPress/gutenberg that referenced this pull request Dec 3, 2021
Unit tests are currently failing on `trunk` (when used with a current snapshot of the WordPress svn or git repo).

Specifically: `Block_Fixture_Test::test_kses_doesnt_change_fixtures` fails for datasets #54 and #55.

Reading WordPress/wordpress-develop#1998, I believe that the reason might be that our KSES routines are verifying that the specified port matches the one of the local install. And since our tests normally run `localhost:8889`, I'm updating the relevant test fixtures (from previously `8888`) to reflect that.
noisysocks pushed a commit to WordPress/gutenberg that referenced this pull request Dec 6, 2021
Unit tests are currently failing on `trunk` (when used with a current snapshot of the WordPress svn or git repo).

Specifically: `Block_Fixture_Test::test_kses_doesnt_change_fixtures` fails for datasets #54 and #55.

Reading WordPress/wordpress-develop#1998, I believe that the reason might be that our KSES routines are verifying that the specified port matches the one of the local install. And since our tests normally run `localhost:8889`, I'm updating the relevant test fixtures (from previously `8888`) to reflect that.
youknowriad pushed a commit to WordPress/gutenberg that referenced this pull request Dec 8, 2021
Unit tests are currently failing on `trunk` (when used with a current snapshot of the WordPress svn or git repo).

Specifically: `Block_Fixture_Test::test_kses_doesnt_change_fixtures` fails for datasets #54 and #55.

Reading WordPress/wordpress-develop#1998, I believe that the reason might be that our KSES routines are verifying that the specified port matches the one of the local install. And since our tests normally run `localhost:8889`, I'm updating the relevant test fixtures (from previously `8888`) to reflect that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants