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

Commentaires toujours refusés si capcha=0 #181

Closed
ortolot opened this issue May 8, 2016 · 3 comments
Closed

Commentaires toujours refusés si capcha=0 #181

ortolot opened this issue May 8, 2016 · 3 comments

Comments

@ortolot
Copy link

ortolot commented May 8, 2016

Bonjour,

En empaquetant la PluXml 5.5 pour Debian, j'ai découvert que, avec capcha=0 (façon de parler, mais vous comprendrez ce que je veux dire…), les commentaires étaient systématiquement refusés ('La vérification anti-spam a échoué').

Cela vient de core/lib/class.plx.motor.php:858, qui vérifie certaines informations liées au capcha, même si celui-ci est désactivé :

                if(strtolower($_SERVER['REQUEST_METHOD'])!= 'post' OR !isset($_SESSION["capcha_token"]) OR !isset($_POST['capcha_token']) OR ($_SESSION["capcha_token"]!=$_POST['capcha_token'])) {
                        return L_NEWCOMMENT_ERR_ANTISPAM;
                }

J'ai corrigé cela en testant d'abord $this->aConf['capcha'] ; vous pourrez trouver ma correction dans http://git.ortolo.eu/pkg-pluxml.git, branche contrib/fix-mandatory-capcha, que vous pouvez récupérer ainsi :

$ git pull git://git.ortolo.eu/pkg-pluxml.git contrib/fix-mandatory-capcha

Si vous préférez, voici également un patch, que vous pouvez appliquer ainsi :

$ patch -p1 < fix-mandatory-captcha.patch
@ortolot
Copy link
Author

ortolot commented May 8, 2016

Bon, en fait GitHub refuse les fichiers dont le nom se termine par .patch, c'est un comble tout de même… Je vous laisse faire un git pull, ça suffira je pense.

@ortolot
Copy link
Author

ortolot commented May 8, 2016

Le code corrigé, ça donne ça :

        if(strtolower($_SERVER['REQUEST_METHOD'])!= 'post' OR $this->aConf['capcha'] AND (!isset($_SESSION["capcha_token"]) OR !isset($_POST['capcha_token']) OR ($_SESSION["capcha_token"]!=$_POST['capcha_token']))) {
            return L_NEWCOMMENT_ERR_ANTISPAM;
        }

@pluxml pluxml changed the title Commentaires touours refusés si capcha=0 Commentaires toujours refusés si capcha=0 May 9, 2016
@pluxml
Copy link
Collaborator

pluxml commented May 11, 2016

merci pour la correction. c'est validé

@pluxml pluxml closed this as completed in 86864d8 May 11, 2016
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

No branches or pull requests

1 participant