We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
acf_get_field_ancestors($field) (acf-field-functions.php) can cause an infinite loop if the field setup is broken and includes a recursive reference.
acf_get_field_ancestors($field)
acf-field-functions.php
To Reproduce Set up a field as {"name": "my_field", "parent": "my_field"} call acf_get_field_ancestors($field)
{"name": "my_field", "parent": "my_field"}
Expected behavior Returns the fields found until recursion is encountered (or throws an exception upon recursion).
// Loop over parents. while ( $field['parent'] && $field = acf_get_field( $field['parent'] ) ) { $ancestors[] = $field['ID'] ? $field['ID'] : $field['key']; }
This part would need a check whether the ID/key is already included, i.e.
// Loop over parents. while ( $field['parent'] && $field = acf_get_field( $field['parent'] ) ) { $idOrKey = $field['ID'] ? $field['ID'] : $field['key']; if(in_array($idOrKey, $ancestors, true)) { break; } $ancestors[] = $idOrKey; }
Version Information:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
acf_get_field_ancestors($field)
(acf-field-functions.php
) can cause an infinite loop if the field setup is broken and includes a recursive reference.To Reproduce
Set up a field as
{"name": "my_field", "parent": "my_field"}
call
acf_get_field_ancestors($field)
Expected behavior
Returns the fields found until recursion is encountered (or throws an exception upon recursion).
This part would need a check whether the ID/key is already included, i.e.
Version Information:
The text was updated successfully, but these errors were encountered: