1
+ <?php
2
+ /**
3
+ * Teampass - a collaborative passwords manager.
4
+ * ---
5
+ * This file is part of the TeamPass project.
6
+ *
7
+ * TeamPass is free software: you can redistribute it and/or modify it
8
+ * under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, version 3 of the License.
10
+ *
11
+ * TeamPass is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
18
+ *
19
+ * Certain components of this file may be under different licenses. For
20
+ * details, see the `licenses` directory or individual file headers.
21
+ * ---
22
+ * @file run.step1.php
23
+ * @author Nils Laumaillé (nils@teampass.net)
24
+ * @copyright 2009-2025 Teampass.net
25
+ * @license GPL-3.0
26
+ * @see https://www.teampass.net
27
+ */
28
+
29
+ use Elegant \Sanitizer \Sanitizer ;
30
+ use voku \helper \AntiXSS ;
31
+
32
+ // Check if function exists
33
+ if (!function_exists ('dataSanitizer ' )) {
34
+ /**
35
+ * Uses Sanitizer to perform data sanitization
36
+ *
37
+ * @param array $data
38
+ * @param array $filters
39
+ * @return array|string
40
+ */
41
+ function dataSanitizer (array $ data , array $ filters ): array |string
42
+ {
43
+ // Load Sanitizer library
44
+ $ sanitizer = new Sanitizer ($ data , $ filters );
45
+
46
+ // Load AntiXSS
47
+ $ antiXss = new AntiXSS ();
48
+
49
+ // Sanitize post and get variables
50
+ return $ antiXss ->xss_clean ($ sanitizer ->sanitize ());
51
+ }
52
+ }
0 commit comments