From 7e8b09b14622e5409f923f7f16238847e4492566 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Sep 2023 00:03:45 +1000 Subject: [PATCH] Minor fixes for imports --- app/Http/Controllers/ImportController.php | 15 ++++++++------- public/storage/.htaccess | 4 ++++ storage/app/public/.gitignore | 0 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 public/storage/.htaccess mode change 100755 => 100644 storage/app/public/.gitignore diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index e8d9a49cf5..6677d9839a 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -123,6 +123,7 @@ class ImportController extends Controller $hit = false; $unsetKey = false; + // array_multisort(array_column($translated_keys, 'label'), SORT_ASC, $translated_keys); foreach($translated_keys as $tkey => $tvalue) { @@ -131,10 +132,10 @@ class ImportController extends Controller $hit = $available_keys[$tvalue['key']]; $unsetKey = $tkey; } - elseif($this->testMatch($value, $tvalue['index'])) { - $hit = $available_keys[$tvalue['key']]; - $unsetKey = $tkey; - } + // elseif($this->testMatch($value, $tvalue['index'])) { + // $hit = $available_keys[$tvalue['key']]; + // $unsetKey = $tkey; + // } } @@ -148,13 +149,13 @@ class ImportController extends Controller } + nlog($translated_keys); + return $hints; } private function testMatch($haystack, $needle): bool - { nlog("needle = {$needle}"); - nlog("haystack = {$haystack}"); - + { return stripos($haystack, $needle) !== false; } diff --git a/public/storage/.htaccess b/public/storage/.htaccess new file mode 100644 index 0000000000..377516b723 --- /dev/null +++ b/public/storage/.htaccess @@ -0,0 +1,4 @@ + +Order deny,Allow +Deny from all + diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore old mode 100755 new mode 100644