@@ -89,10 +89,10 @@ public function show($params)
8989 }
9090
9191 try {
92- $ hostname = trim ((string )($ _POST ['hostname ' ] ?? '' )); // "www" or ""
93- $ type = strtoupper (trim ((string )($ _POST ['type ' ] ?? '' )));
94- $ address = trim ((string )($ _POST ['address ' ] ?? '' ));
95- $ priority = trim ((string )($ _POST ['priority ' ] ?? '' ));
92+ $ hostname = html_entity_decode ( trim ((string ) ($ _POST ['hostname ' ] ?? '' )), ENT_QUOTES , ' UTF-8 ' );
93+ $ type = strtoupper (trim ((string ) ($ _POST ['type ' ] ?? '' )));
94+ $ address = html_entity_decode ( trim ((string ) ($ _POST ['address ' ] ?? '' )), ENT_QUOTES , ' UTF-8 ' );
95+ $ priority = html_entity_decode ( trim ((string ) ($ _POST ['priority ' ] ?? '' )), ENT_QUOTES , ' UTF-8 ' );
9696
9797 if ($ type === '' || $ address === '' ) {
9898 http_response_code (400 );
@@ -300,10 +300,10 @@ private function buildDnsRecordsFromPost(): array
300300 $ priority = $ _POST ['dnsrecordpriority ' ] ?? [];
301301
302302 foreach ($ hosts as $ i => $ host ) {
303- $ host = trim ((string )$ host );
304- $ type = strtoupper (trim ((string )($ types [$ i ] ?? '' )));
305- $ address = trim ((string )($ addresses [$ i ] ?? '' ));
306- $ prio = trim ((string )($ priority [$ i ] ?? '' ));
303+ $ host = html_entity_decode ( trim ((string ) $ host), ENT_QUOTES , ' UTF-8 ' );
304+ $ type = strtoupper (trim ((string ) ($ types [$ i ] ?? '' )));
305+ $ address = html_entity_decode ( trim ((string ) ($ addresses [$ i ] ?? '' )), ENT_QUOTES , ' UTF-8 ' );
306+ $ prio = html_entity_decode ( trim ((string ) ($ priority [$ i ] ?? '' )), ENT_QUOTES , ' UTF-8 ' );
307307
308308 // Skip completely empty rows
309309 if ($ host === '' && $ address === '' ) {
0 commit comments