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 ajax field nonce for ACF Pro >= 6.3.2 #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jhtjards
Copy link

@jhtjards jhtjards commented Aug 5, 2024

ACF 6.3.2 broke this plugin because of a change in how the nonce is verified.
Please merge my fix :)

I've also included a little check for the existence of the requested array offsets, as this was another issue i've come across before.

Kind Regards
Jann

From ACF changelog: "Security Fix - ACF now generates different nonces for each AJAX-enabled field, preventing subscribers or front-end form users from querying other field results"

Solution taken from ACF @ includes/fields/class-acf-field-post_object.php
I've come across an issue where the plugin triggered a fatal error because of a non-existent array offset.

I'm not 100% sure how it was triggered, maybe by deleting a previously selected post, or maybe by saving an empty field, but checking with isset() first fixed it.

(Described in timiwahalahti#2 (comment))
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.

1 participant