From 65e09278dce07ac16e72a2377cbf1bd3ca376433 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sun, 8 Nov 2020 14:44:06 +0100 Subject: [PATCH] Fix incorrect xml file path in ZIP creation phpcs-errors:0 phpunit-status:successful phpstan-errors:1 --- public/index3.php | 5 +++-- public/index6.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/index3.php b/public/index3.php index 782b932..b75f89b 100644 --- a/public/index3.php +++ b/public/index3.php @@ -19,6 +19,7 @@ else if (!isset($_SESSION['lang'])) { $_SESSION['lang'] = MD_STD::lang_getfrombrowser($allowed_langs, 'en', "", false); } $lang = $_SESSION['lang']; +$tlLoader = new MDTlLoader("csxml_evaluate", $lang); $filename = $_GET['fnam']; $csv_datei = MD_STD::realpath(__DIR__ . '/../csv/' . $filename); @@ -34,7 +35,7 @@ foreach ($availableFields as $categoryName => $fieldCategory) { $allowed = array_merge($allowed, array_keys($fieldCategory)); // Extended operations for events - if (strpos($categoryName, $basis['event']) !== false) { + if (strpos($categoryName, $tlLoader->tl("basis", "basis", 'event')) !== false) { foreach ($fieldCategory as $key => $value) { if (strpos($key, "_annotation") !== false or strpos($key, "_gnd") !== false) continue; if (strpos($key, "_sure") !== false) $eventpartsure[] = $key; @@ -339,7 +340,7 @@ if ($hasanyimage > 0) { //check if in a row any image_name is given $maimg = $hatimg = 0; foreach ($imagemain as $im => $tMainImage) { - if ($inhalt[$i][$tMainImage] != '') $hatimg++; + if ($inhalt[$i][$tMainImage["name"]] != '') $hatimg++; } if ($hatimg > 0) { // first check: how many main-images? diff --git a/public/index6.php b/public/index6.php index da6cb71..1803ff6 100644 --- a/public/index6.php +++ b/public/index6.php @@ -39,7 +39,7 @@ while ($zeile = fgetcsv($fp, 100000, ';')) { $y++; - $zieldatei = 'xml/' . $y . '.xml'; + $zieldatei = __DIR__ . '/../xml/' . $y . '.xml'; if (!$handle = fopen($zieldatei, 'w')) { echo "Cannot open file ($zieldatei)";exit; }