Projet

Général

Profil

Bug #67665

matomo: passer les paramètres publics des appels WS vers matomo dans la query-string

Ajouté par Nicolas Roche il y a presque 2 ans. Mis à jour il y a presque 2 ans.

Statut:
Rejeté
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
23 juillet 2022
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Pour comparer dans les logs nginx le paramètre "email",
  • reçu depuis la recette du SaaS où la configuration automatique de matomo échoue,
  • avec celui reçu depuis une instance devinst où la configuration fonctionne :
    POST /?method=UsersManager.addUser&userLogin=combo.dev.publik.love&email=noreply%2Bcombo.dev.publik.love%40entrouvert.org&initialIdSite=54&module=API&language=en
    

Fichiers

Historique

#2

Mis à jour par Nicolas Roche il y a presque 2 ans

#3

Mis à jour par Nicolas Roche il y a presque 2 ans

  • Assigné à mis à Nicolas Roche
#4

Mis à jour par Frédéric Péters il y a presque 2 ans

  • Statut changé de Solution proposée à Rejeté
#6

Mis à jour par Frédéric Péters il y a presque 2 ans

L'email reçu est

Ça s'obtient en modifiant l'API.php pour l'inclure dans l'erreur :

        if (!Piwik::isValidEmailString($email)) {
            throw new Exception(Piwik::translate('UsersManager_ExceptionInvalidEmail') . "(email: $email)");
        }

Après avoir redémarré hobo pour prendre en compte le /etc/hobo/settings.d/matomo.py ça revient à la valeur attendue, .

Le problème ici est côté PHP ou Matomo,

$ php -a
Interactive mode enabled

php > $email = "noreply+portail-mesdemarchesenmairie-thononagglo.test.entrouvert.org@entrouvert.org";
php > if (filter_var($email, FILTER_VALIDATE_EMAIL)) { echo("$email is a valid email address"); }
php >
php > $email = "noreply+portail-mesdemarchesenmairie-thononagglo@entrouvert.org";
php > if (filter_var($email, FILTER_VALIDATE_EMAIL)) { echo("$email is a valid email address"); }
noreply+portail-mesdemarchesenmairie-thononagglo@entrouvert.org is a valid email address

...

php > if (filter_var("1234567890123456789012345678901234567890123456789012345678901234@entrouvert.org", FILTER_VALIDATE_EMAIL)) { echo("$email is a valid email addr
noreply+portail-mesdemarchesenmairie-thononagglo.test@entrouvert.org is a valid email address

php > if (filter_var("12345678901234567890123456789012345678901234567890123456789012345@entrouvert.org", FILTER_VALIDATE_EMAIL)) { echo("$email is a valid email address"); }

...

php > if (filter_var("1234567890123456789012345678901234567890123456789012345678901234@a.be", FILTER_VALIDATE_EMAIL)) { echo("$email is a valid email address"); }
noreply+portail-mesdemarchesenmairie-thononagglo.test@entrouvert.org is a valid email address

php > if (filter_var("12345678901234567890123456789012345678901234567890123456789012345@a.be", FILTER_VALIDATE_EMAIL)) { echo("$email is a validemail address"); }

Il y a dans la validation PHP une limite à 64 caractères pour la partie locale de l'adresse.

Ça correspond à la RFC, https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1.1

4.5.3.1.1. Local-part

The maximum total length of a user name or other local-part is 64 octets.

Formats disponibles : Atom PDF