Commit Graph

113 Commits

Author SHA1 Message Date
Christian König
68ac05fb7e Do not fail if IDNA<->UNICODE conversion fails
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-01-20 17:04:30 +01:00
RD WebDesign
93db592f74 Add test to avoid PHP warning
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-09-17 02:16:49 -03:00
RD WebDesign
d12ef014e5 Use constants in place of class constants
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-09-08 23:47:09 -03:00
Christian König
e5ce53446c Do not apply IDNA conversion to regex domains
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-09-07 21:48:03 +02:00
Christian König
f4c264be86 Add special handling for the root zone on domain validation and IDNA conversion
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-08-28 21:56:36 +02:00
DL6ER
6a39cc3b4a Disable Yoda style
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-12 18:55:27 +02:00
DL6ER
87cc78d024 Fix unecessary string concat added during the conversion from PhpCsFixer to Symfony
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-07 21:50:34 +02:00
DL6ER
91e7708c4f Switch to style Symfony
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-07 21:46:34 +02:00
DL6ER
97a76669a2 Explicitly set blank_line_before_statement to exclude include* and require*
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-07 20:55:02 +02:00
DL6ER
6ec4b8a529 Run PHP-CS-Fixer on all files
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-07 12:04:03 +02:00
RD WebDesign
2bc918ad6e Use 4 spaces to indent PHP files.
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-08-01 01:18:26 -03:00
Christian König
6a1e590a07 Remove black/whitelist from group pages
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-16 14:20:43 +02:00
Christian König
7208e794af Create separat converIDNAToUnicode function in func.php
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-13 22:10:10 +02:00
Christian König
678b4c96b6 Create separat convertDomainToIDNA function in func.php
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-13 19:42:18 +02:00
yubiuser
6656865e5b Omit idn_domain as it is not necessary
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>

Signed-off-by: yubiuser <ckoenig@posteo.de>
2022-07-13 09:15:01 +02:00
Christian König
154e85d568 Allow to delete IDN via API
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-10 23:20:25 +02:00
yubiuser
ff350449c0 Use simpler logic
Co-authored-by: Adam Warner <me@adamwarner.co.uk>

Signed-off-by: yubiuser <ckoenig@posteo.de>
2022-06-12 13:24:53 +02:00
Christian König
a75e8fc1d3 Also check wildcard domains for validity before adding
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-05-26 23:34:52 +02:00
RD WebDesign
e2e3b07a0e Remove duplicate function declarations
and move functions to `func.php`.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-05-11 18:14:37 -03:00
yubiuser
042b54675c Merge pull request #2177 from pi-hole/bulk_delete_groups
Allow delete multiple items - Group pages
2022-05-07 21:06:01 +02:00
RD WebDesign
f0bd5d725e Fixing minor inconsistencies
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-05-07 15:37:39 -03:00
RD WebDesign
a4bd5d0d90 Quote SQL reserved word and fix javascript output.
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-04-30 16:08:02 -03:00
RD WebDesign
f8ab31f431 Allow delete multiple items - Group pages
- add checkboxes, buttons and functions to groups page;
- add checkboxes, buttons and functions to clients page;
- add checkboxes, buttons and functions to domains page;
- add checkboxes, buttons and functions to adlists page;
- move function to `utils.js`;
- fix CSS after insert a new table column;

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-04-22 22:22:03 -03:00
Adam Warner
242654e149 Fix some suggestions / ignore others
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-22 17:17:59 +01:00
RD WebDesign
b94884ae17 Show ignored items when adding new adlists (#1997)
* Show ignored itens when adding new adlists

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>

* Show ignored itens when adding new adlists (new messages)

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
2021-12-17 19:56:49 +01:00
Adam Warner
01191c7a1b Merge pull request from GHSA-mhr8-7rvg-8r43
* Prevent possible XSS attack vector on add_client
Update JS code to prevent possible XSS vector

Co-authored-by: Harold Kim <root@stypr.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>

* Fix both addClient and deleteClient to prevent XSS

Signed-off-by: Harold Kim <root@stypr.com>

Co-authored-by: Harold Kim <root@stypr.com>
2021-10-23 19:26:07 +01:00
a1346054
48c63c0a0b Fix spelling
Signed-off-by: a1346054 <36859588+a1346054@users.noreply.github.com>
2021-09-15 21:22:59 +00:00
Adam Warner
647eba40d3 Merge branch 'release/v5.6' into devel 2021-08-04 20:32:59 +01:00
Adam Warner
dacdb3d72c Merge pull request #1857 from pi-hole/master
Sync Master -> Dev
2021-08-04 20:21:44 +01:00
Adam Warner
8066069a1f Prevent arbritary js code from beign returned from the database
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-04 17:29:57 +01:00
DL6ER
559150bb1f Fix inverse logic when adding domains on the group management pages.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-07-25 19:03:34 +02:00
DL6ER
03920e3595 Move validation functions into func.php and use the same validation in all cases.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-07-25 16:59:16 +02:00
DL6ER
ca71bc8df8 Check if we can get a host name from the database when looking up the MAC address of this client instead
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-04-29 09:28:12 +02:00
Adam Warner
952c1572f5 Merge pull request #1683 from mdujava/basic_auth
Url of adlist can contain userinfo (basicauth)
2021-01-13 20:41:50 +00:00
Adam Warner
509a082d02 Update scripts/pi-hole/php/groups.php 2021-01-13 20:40:04 +00:00
Matej Dujava
c09263b926 Adlist can contain userinfo (basicauth)
Web side of fix https://github.com/pi-hole/pi-hole/pull/3912

Signed-off-by: Matej Dujava <mdujava@kocurkovo.cz>
2021-01-05 19:54:28 +01:00
DL6ER
ba1ac8621f Use empty array for foreach() when no group is to be set, always commit when editing domains, and report any errors while commiting.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-12-28 07:57:58 +01:00
DL6ER
564a4838ae Fix transactions in groups.php
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-12-23 15:21:57 +01:00
Adam Warner
483f5037db Merge pull request #1625 from pi-hole/tweak/replace_domains
Add new replace_domain action to allow adding domain(s) exclusively to a specific list
2020-11-28 16:25:38 +00:00
DL6ER
c8b85b8596 Use INSERT OR IGNORE instead of REPLACE
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-10 21:26:01 +01:00
DL6ER
ad43e5a8dc Add missing space and extend error hiding timeout from 4 to 10 seconds.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-09 21:21:30 +01:00
DL6ER
4557846858 Use JOIN instead of nested SELECT
Signed-off-by: DL6ER <dl6er@dl6er.de>
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
2020-11-09 21:17:26 +01:00
DL6ER
f5a39ce1e4 Check if replacing the domain messes with existing special groups settings. Don't change it but show a warning if this is the case.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-08 22:52:03 +01:00
DL6ER
90c9ebc54b Ensure empty clients/groups/adlists/audits cannot be added
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-08 22:06:30 +01:00
DL6ER
0e924fd910 Add new replace_domain action in groups.php to allow adding domain(s) exclusively to a specific list. In this mode, any occurrences of said domain are first removed from the list before adding the new ones.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-08 18:51:49 +01:00
DL6ER
1b129bcad0 Merge branch 'release/v5.2' into new/mac_clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-30 21:56:21 +02:00
DL6ER
fdea341c9f Fix audit log button doing nothing (resp. wrongthing)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-20 22:04:59 +02:00
Adam Warner
c949516ee1 make use of utils.escapeHtml on the JS side of things, and html_entity_decode/htmlentities in PHP
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-06-13 18:50:36 +01:00
Adam Warner
5b71dab0c7 Change INSERT statement to INSERT OR IGNORE on adlist management as a workaround for now
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-06-06 18:27:22 +01:00
DL6ER
a901489a96 Merge branch 'devel' into new/mac_clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-06-05 22:24:17 +02:00