update Export
All checks were successful
Deploy Workshop-Wahlen (DEV / PROD) / deploy (push) Successful in 13s
All checks were successful
Deploy Workshop-Wahlen (DEV / PROD) / deploy (push) Successful in 13s
This commit is contained in:
@@ -61,6 +61,13 @@ function kc_teilnehmer_page() {
|
|||||||
$delimiter = ';';
|
$delimiter = ';';
|
||||||
fputcsv($output, ['Vorname','Nachname','Wahl','Phase','Wunsch 1','Wunsch 2','Wunsch 3'], $delimiter);
|
fputcsv($output, ['Vorname','Nachname','Wahl','Phase','Wunsch 1','Wunsch 2','Wunsch 3'], $delimiter);
|
||||||
|
|
||||||
|
$csv_clean = function($value) {
|
||||||
|
$text = html_entity_decode((string)$value, ENT_QUOTES | ENT_HTML5, 'UTF-8');
|
||||||
|
$text = wp_strip_all_tags($text, true);
|
||||||
|
$text = preg_replace('/\s+/u', ' ', $text);
|
||||||
|
return trim($text);
|
||||||
|
};
|
||||||
|
|
||||||
foreach ($export_rows as $tn) {
|
foreach ($export_rows as $tn) {
|
||||||
$w1_id = intval($tn->wunsch1);
|
$w1_id = intval($tn->wunsch1);
|
||||||
$w2_id = intval($tn->wunsch2);
|
$w2_id = intval($tn->wunsch2);
|
||||||
@@ -72,12 +79,12 @@ function kc_teilnehmer_page() {
|
|||||||
|
|
||||||
$wahl_name = isset($wahl_name_map[intval($tn->wahl_id)]) ? $wahl_name_map[intval($tn->wahl_id)] : '';
|
$wahl_name = isset($wahl_name_map[intval($tn->wahl_id)]) ? $wahl_name_map[intval($tn->wahl_id)] : '';
|
||||||
|
|
||||||
$vorname = preg_replace('/<[^>]*>/', '', $tn->vorname);
|
$vorname = $csv_clean($tn->vorname);
|
||||||
$nachname = preg_replace('/<[^>]*>/', '', $tn->nachname);
|
$nachname = $csv_clean($tn->nachname);
|
||||||
$wahl_name_clean = preg_replace('/<[^>]*>/', '', $wahl_name);
|
$wahl_name_clean = $csv_clean($wahl_name);
|
||||||
$w1_clean = preg_replace('/<[^>]*>/', '', $w1_disp);
|
$w1_clean = $csv_clean($w1_disp);
|
||||||
$w2_clean = preg_replace('/<[^>]*>/', '', $w2_disp);
|
$w2_clean = $csv_clean($w2_disp);
|
||||||
$w3_clean = preg_replace('/<[^>]*>/', '', $w3_disp);
|
$w3_clean = $csv_clean($w3_disp);
|
||||||
|
|
||||||
fputcsv($output, [
|
fputcsv($output, [
|
||||||
$vorname,
|
$vorname,
|
||||||
|
|||||||
Reference in New Issue
Block a user