Ajout d'un exemple pour google recaptcha dans PHP
This commit is contained in:
parent
34d60082fb
commit
e99e0aac21
24
HowtoPHP.md
24
HowtoPHP.md
|
@ -751,3 +751,27 @@ php_admin_value sendmail_path "/bin/true -t -i -f www-foo"
|
||||||
~~~
|
~~~
|
||||||
php_admin_value sendmail_path "/bin/true"
|
php_admin_value sendmail_path "/bin/true"
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
* `allow_url_fopen = Off` empêche d’utiliser file_get_contents
|
||||||
|
|
||||||
|
La solution est d’utiliser
|
||||||
|
(fsockopen())[https://secure.php.net/manual/fr/function.fsockopen.php]
|
||||||
|
plutôt que
|
||||||
|
(file_get_contents())[https://secure.php.net/manual/fr/function.file-get-contents.php].
|
||||||
|
Il faut faire attention parce que cette API est aussi vulnérable a
|
||||||
|
(certaines attaques)[https://www.owasp.org/index.php/PHP_Top_5].
|
||||||
|
|
||||||
|
|
||||||
|
Exemple pour (Google Recaptcha)[http://www.google.com/recaptcha/intro/v3.html]:
|
||||||
|
|
||||||
|
Remplacer
|
||||||
|
|
||||||
|
```
|
||||||
|
$recaptcha = new \ReCaptcha\ReCaptcha($secret);
|
||||||
|
```
|
||||||
|
|
||||||
|
Par
|
||||||
|
|
||||||
|
```
|
||||||
|
$recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\SocketPost());
|
||||||
|
```
|
Loading…
Reference in a new issue