-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Font Library: fix infinite loop when calling wp_get_upload_dir in a function that's used to filter font_dir #58839
Conversation
…used to filter font_dir
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.5/fonts/class-wp-rest-font-faces-controller.php ❔ lib/compat/wordpress-6.5/fonts/fonts.php |
lib/compat/wordpress-6.5/fonts/class-wp-rest-font-faces-controller.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
lib/compat/wordpress-6.5/fonts/class-wp-rest-font-faces-controller.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well for me, following the testing instructions to change the fonts folder to be within wp-content/uploads. I was able to install and delete fonts with font files in that directory.
One thing to note is that the very first font I installed, I saw an error (the same one we are tracking in #59023), but couldn't replicate it after the first time. That's not related to this change, so I don't think it should block this PR.
…unction that's used to filter font_dir (#58839) * fix infinite loop when calling wp_get_upload_dir in a function thats used to filter font_dir * remove not needed parameter * remove filter after use * removing not needed parameter * Add a comment explaining the reasons behind the implementation Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com> * fix spaces Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com> --------- Co-authored-by: matiasbenedetto <mmaattiiaass@git.wordpress.org> Co-authored-by: costdev <costdev@git.wordpress.org> Co-authored-by: creativecoder <grantmkin@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: dd32 <dd32@git.wordpress.org> Co-authored-by: jazzsequence <jazzs3quence@git.wordpress.org>
I just cherry-picked this PR to the update/packages-6.5-rc1 branch to get it included in the next release: b5f2b33 |
…unction that's used to filter font_dir (#58839) * fix infinite loop when calling wp_get_upload_dir in a function thats used to filter font_dir * remove not needed parameter * remove filter after use * removing not needed parameter * Add a comment explaining the reasons behind the implementation Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com> * fix spaces Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com> --------- Co-authored-by: matiasbenedetto <mmaattiiaass@git.wordpress.org> Co-authored-by: costdev <costdev@git.wordpress.org> Co-authored-by: creativecoder <grantmkin@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: dd32 <dd32@git.wordpress.org> Co-authored-by: jazzsequence <jazzs3quence@git.wordpress.org>
What?
Fix infinite loop when calling
wp_get_upload_dir
in a function that's used to filterfont_dir
.An alternative approach to: WordPress/wordpress-develop#6198
Why?
This avoids an infinite loop that can occur if
wp_upload_dir()
is called inside a 'font_dir' callback.Fix: #58696
Testing instructions
wp_get_upload_dir()
inside a function used to filterupload_dir
as in the following example:(
wp-content/uploads/fonts
in the example provided).