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

Make get_validated_url_file_path() better compatible with register_theme_directory() #1790

Merged
merged 1 commit into from Jan 2, 2019

Conversation

Projects
None yet
3 participants
@westonruter
Copy link
Member

commented Jan 1, 2019

In the wordpressdev Lando setup, register_theme_directory() is used to ensure that core-bundled themes can continue to be used in addition to the themes defined in the WP_CONTENT_DIR. This is causing a problem for \AMP_Style_Sanitizer::get_validated_url_file_path():

image

In order to fix this specific problem, we need to explicitly allow ABSPATH . 'wp-content' as a filesystem directory that files can be referenced from.

I don't believe this is the ultimate solution for any issue that may arise from having custom directories for themes and plugins, but for the time being at least it fixes this issue in the Lando environment.

@westonruter westonruter added this to the v 1.0.2 milestone Jan 1, 2019

@westonruter westonruter requested a review from felixarntz Jan 1, 2019

@googlebot googlebot added the cla: yes label Jan 1, 2019

@felixarntz
Copy link
Collaborator

left a comment

Shouldn't we rather iterate over available theme directories?

@westonruter

This comment has been minimized.

Copy link
Member Author

commented Jan 2, 2019

@felixarntz I thought about that but we'd also need to figure out the URL for the theme directory. The case here was easy because it is just the site URL plus wp-content. So I think we should do that eventually, but this fixes the immediate problem.

@felixarntz

This comment has been minimized.

Copy link
Collaborator

commented Jan 2, 2019

@westonruter Sounds good. Would be great to track this in a follow-up issue so we don't forget it, even (or especially) if we don't wanna work on it right away.

@westonruter

This comment has been minimized.

Copy link
Member Author

commented Jan 2, 2019

Thanks. Opened #1793 to track this.

@westonruter westonruter merged commit a91c9cc into 1.0 Jan 2, 2019

3 checks passed

cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the update/get-validated-url-file-path branch Jan 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.