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

Fix/paginate links warning #2712

Merged
merged 2 commits into from
Aug 9, 2024
Merged

Fix/paginate links warning #2712

merged 2 commits into from
Aug 9, 2024

Conversation

ideadude
Copy link
Member

@ideadude ideadude commented Aug 7, 2024

Description

A user reported this issue in the 7.7 update on wp .org here: https://wordpress.org/support/topic/preg_replace-passing-null-to-parameter-3-subject/#post-17939000

Our code like echo wp_kses_post( paginate_links( ... ) ); would sometimes return warnings if the results of the paginate_links call was empty. This is because wp_kses_post called wp_kses, which calls preg_replace at some point down the line, which expects the content being replaced is not empty.

We now set a variable using paginate_links, then check if that result is non empty before echoing and calling wp_kses_post.

How has this been tested?

Manually loading the memberships and notifications pages of the student dashboard with both pagination and not.

Checklist:

  • This PR requires and contains at least one changelog file.
  • My code has been tested.
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Standards.

@ideadude ideadude added this to the Next Available Release milestone Aug 7, 2024
@ideadude ideadude merged commit 95ce07b into dev Aug 9, 2024
37 of 44 checks passed
@ideadude ideadude deleted the fix/paginate-links-warning branch August 9, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants