Ran PHPCBF

phpcs-errors:253 phpunit-status:successful
This commit is contained in:
Joshua Ramon Enslin 2019-11-12 21:25:37 +01:00 committed by Stefan Rohde-Enslin
parent bf985ae192
commit d6470110e9
6 changed files with 2477 additions and 2469 deletions

View File

@ -54,7 +54,7 @@ foreach ($availableFields as $categoryName => $fieldCategory) {
} }
$allowed_inclusion_kind_of = array('inclusion_kind_of', 'Schenkung', 'Kauf', 'Grabung', 'Notbergung', 'Erbschaft', 'Stiftung', 'Enteignung', 'Ursprungsbestand', 'Ajándékozás','Vétel','Feltárás','Hivatalos átadás','Csere','Gyűjtés','Saját előállítás','Törzsanyag','Letét', 'endowment', 'dispossession', 'old stock', ''); $allowed_inclusion_kind_of = ['inclusion_kind_of', 'Schenkung', 'Kauf', 'Grabung', 'Notbergung', 'Erbschaft', 'Stiftung', 'Enteignung', 'Ursprungsbestand', 'Ajándékozás','Vétel','Feltárás','Hivatalos átadás','Csere','Gyűjtés','Saját előállítás','Törzsanyag','Letét', 'endowment', 'dispossession', 'old stock', ''];
///// Check #1 ///// Check #1
//echo '<pre>';print_r($allowed);echo '</pre>'; //echo '<pre>';print_r($allowed);echo '</pre>';
@ -113,7 +113,7 @@ function get_duplicates($array) {
} }
$mandatory = array('inventory_number','object_type','object_title','object_description'); $mandatory = ['inventory_number','object_type','object_title','object_description'];
for ($i = 0; $i < count($mandatory); $i++) { for ($i = 0; $i < count($mandatory); $i++) {
if (!in_array($mandatory[$i], $erstezeile)) { if (!in_array($mandatory[$i], $erstezeile)) {
echo '<br><i style="font-style:normal;color:#990000;">Mandatory: Column <b>' . $mandatory[$i] . '</b> missing</i>'; echo '<br><i style="font-style:normal;color:#990000;">Mandatory: Column <b>' . $mandatory[$i] . '</b> missing</i>';
@ -189,8 +189,8 @@ else {
///// Check #6 ///// Check #6
echo '<br><br>6: Dependency of content observed?'; echo '<br><br>6: Dependency of content observed?';
$crosscheck1 = array('object_other_title','detailed_description','detailed_description','inscription','inscription','dimensions_separate_length_value', 'dimensions_separate_width_value', 'dimensions_separate_height_value', 'dimensions_separate_diameter_value', 'dimensions_separate_wall_thickness_value', 'dimensions_separate_weight_value','closer_location','bought_for','worth_value','worth_insurance_value'); $crosscheck1 = ['object_other_title','detailed_description','detailed_description','inscription','inscription','dimensions_separate_length_value', 'dimensions_separate_width_value', 'dimensions_separate_height_value', 'dimensions_separate_diameter_value', 'dimensions_separate_wall_thickness_value', 'dimensions_separate_weight_value','closer_location','bought_for','worth_value','worth_insurance_value'];
$crosscheck2 = array('object_other_title_kind_of','detailed_description_md','detailed_description_extern','inscription_md','inscription_extern','dimensions_separate_length_unit', 'dimensions_separate_width_unit', 'dimensions_separate_height_unit', 'dimensions_separate_diameter_unit', 'dimensions_separate_wall_thickness_unit', 'dimensions_separate_weight_unit','closer_location_as','bought_for_currency','worth_unit','worth_insurance_unit'); $crosscheck2 = ['object_other_title_kind_of','detailed_description_md','detailed_description_extern','inscription_md','inscription_extern','dimensions_separate_length_unit', 'dimensions_separate_width_unit', 'dimensions_separate_height_unit', 'dimensions_separate_diameter_unit', 'dimensions_separate_wall_thickness_unit', 'dimensions_separate_weight_unit','closer_location_as','bought_for_currency','worth_unit','worth_insurance_unit'];
$depcon_error = 0; $depcon_error = 0;
for ($l = 0; $l < count($crosscheck1); $l++) { for ($l = 0; $l < count($crosscheck1); $l++) {

View File

@ -1,7 +1,13 @@
<?PHP <?PHP
function transform($transform) /**
{ * Function for sanitizing contents for prospective XML contents.
*
* @param string $transform Input string.
*
* @return string
*/
function transform(string $transform):string {
$transform = str_replace(chr(14), "", $transform); $transform = str_replace(chr(14), "", $transform);
$transform = str_replace('&quot;', '"', $transform); $transform = str_replace('&quot;', '"', $transform);
$transform = str_replace('&', '&amp;', $transform); $transform = str_replace('&', '&amp;', $transform);
@ -24,8 +30,14 @@ function transform($transform)
} }
function tagify($tagify) /**
{ * Function for sanitizing contents for prospective XML contents.
*
* @param string $tagify Input string.
*
* @return string
*/
function tagify(string $tagify):string {
$tagify = str_replace(' ', '_', $tagify); $tagify = str_replace(' ', '_', $tagify);
$tagify = str_replace('/', '_', $tagify); $tagify = str_replace('/', '_', $tagify);
$tagify = str_replace(',', '_', $tagify); $tagify = str_replace(',', '_', $tagify);

View File

@ -438,4 +438,3 @@ class Zip {
$this->offset += strlen($zipEntry) + $gzLength; $this->offset += strlen($zipEntry) + $gzLength;
} }
} }
?>

View File

@ -23,8 +23,6 @@ else if (!isset($_SESSION['lang'])) {
} }
$lang = $_SESSION['lang']; $lang = $_SESSION['lang'];
require __DIR__ . '/inc/zeichen.php';
if (empty($filename = trim($_GET['fnam'], " ,./"))) { if (empty($filename = trim($_GET['fnam'], " ,./"))) {
echo "Error: Invalid file name"; echo "Error: Invalid file name";
exit; exit;
@ -66,7 +64,6 @@ while ($zeile = fgetcsv($fp, 100000, ';')) {
if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ'; if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ';
$record_node->appendChild(createTextDomElement($xmlDoc, trim($inhalt[1][$x]), trim($inhalt[$y][$x]))); $record_node->appendChild(createTextDomElement($xmlDoc, trim($inhalt[1][$x]), trim($inhalt[$y][$x])));
# $somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '</' . tagify(transform($inhalt[1][$x])) . '>' . "\n"; //für ungarn sonst weg //////////////////////////////////////////////////////////////
} }