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

Make request method configurable #396

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

hakito
Copy link
Contributor

@hakito hakito commented Jul 25, 2024

The default request method of recaptcha is post. This uses the method file_get_contents to execute the request. This might be blocked.

This PR makes the request method configurable. The default is still post. However I changed it to curl in the default config file.

I also fixed the logging.

@@ -141,6 +141,7 @@
$conf['settings']['recaptcha']['enabled'] = 'false';
$conf['settings']['recaptcha']['public.key'] = '';
$conf['settings']['recaptcha']['private.key'] = '';
$conf['settings']['recaptcha']['request.method'] = 'curl'; // options are curl, post or socket. default: post
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically makes the default curl. Why not make it post?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post uses file_get_contents which requires the option allow_url_fopen to be enabled. Because this could cause security issues and therefore it might not be enabled by default. On the other side I can hardly imagine a PHP installation without CURL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made post the default anyway so, that existing installations have the same behavior as before, when the setting is not added.

@hakito hakito marked this pull request as ready for review July 25, 2024 09:19
@effgarces effgarces merged commit d2d02d0 into LibreBooking:develop Aug 1, 2024
1 check passed
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.

3 participants