]> git.agnieray.net Git - galette.git/commitdiff
Sanitize member values
authorJohan Cwiklinski <johan@x-tnd.be>
Sun, 14 Feb 2021 14:17:58 +0000 (15:17 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Mon, 5 Apr 2021 07:47:02 +0000 (09:47 +0200)
galette/lib/Galette/Entity/Adherent.php
tests/GaletteTestCase.php

index af66dd631975b5a50da83d413450d589ff2c622e..aca9cd5668b763630941f040f8138b1efa32a65b 100644 (file)
@@ -1030,6 +1030,13 @@ class Adherent
     {
         $this->errors = array();
 
+        //Sanitize
+        foreach ($values as &$value) {
+            if (is_string($value)) {
+                $value = strip_tags($value);
+            }
+        }
+
         $fields = self::getDbFields($this->zdb);
 
         //reset company name if needeed
index 660bf98b4cdde03ddad042d35c127bf3608338ba..31da38260027d409bb0127581140c17294de9f04 100644 (file)
@@ -329,7 +329,11 @@ abstract class GaletteTestCase extends atoum
                     $this->string($adh->getAge())->isIdenticalTo(' (82 years old)');
                     break;
                 default:
-                    $this->variable($adh->$property)->isIdenticalTo($value, $property);
+                    $this->variable($adh->$property)->isIdenticalTo(
+                        $value,
+                        "$property expected {$value} got {$adh->$property}"
+                    );
+
                     break;
             }
         }