Closed mralaminahamed closed 4 weeks ago
The validate_registration
function in includes/Registration.php
was updated to improve validation logic. The function now checks if the $_POST['role']
field is empty, in addition to verifying that the role is within the allowed roles array. This change ensures that a role must be selected during registration.
File | Change Summary |
---|---|
includes/Registration.php |
Modified validate_registration to check if $_POST['role'] is empty in addition to role validation. |
sequenceDiagram
participant User
participant RegistrationForm
participant Registration
User->>RegistrationForm: Fills registration form
RegistrationForm->>Registration: Submits form with role
Registration->>Registration: validate_registration()
alt Role is empty or invalid
Registration-->>RegistrationForm: Return error
else Role is valid
Registration-->>RegistrationForm: Proceed with registration
end
In the fields where code does roam,
A role must find its rightful home.
No empty slots, no roles astray,
The registration's smooth today.
With checks so clear, the bugs do flee,
A happy coder, full of glee.
🌸🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All Submissions:
Changes proposed in this Pull Request:
Fix: PHP Warning when trying to remove action
remove_action( 'woocommerce_register_form', 'dokan_seller_reg_form_fields' );
Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
Changelog entry
Fix: PHP Warning when trying to remove action
remove_action( 'woocommerce_register_form', 'dokan_seller_reg_form_fields' );
Before Changes
Describe the issue before changes with screenshots(s).
After Changes
Describe the issue after changes with screenshot(s).
Feature Video (optional)
Link of detailed video if this PR is for a feature.
PR Self Review Checklist:
FOR PR REVIEWER ONLY:
Summary by CodeRabbit