From 67e346c2c6e4d48ffe085100e2f486b7bd8aa5a5 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 15 Mar 2023 17:56:41 +0100 Subject: [PATCH] wait #5795 @0.25 --- app/Fluidbook/SEO/Document.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/Fluidbook/SEO/Document.php b/app/Fluidbook/SEO/Document.php index 21c51b4e1..4ac319a2e 100644 --- a/app/Fluidbook/SEO/Document.php +++ b/app/Fluidbook/SEO/Document.php @@ -2,10 +2,12 @@ namespace App\Fluidbook\SEO; +use App\Http\Controllers\Admin\Operations\Tools\Excel2JSON; use App\Jobs\FluidbookCompiler; use App\Models\FluidbookDocument; -use App\Util\Excel; -use Cubist\Util\Json; + + +use Cubist\Excel\ExcelToArray; use Cubist\Util\Text; class Document @@ -34,7 +36,7 @@ class Document $file = $this->compiler->getSetting('seoAdvanced', ''); if ($file) { - $sheets = Excel::excelToArray($this->compiler->working_path($file), true); + $sheets = ExcelToArray::excelToAssoc($this->compiler->working_path($file), true); foreach ($sheets as $sheet) { $a = $sheet; break; @@ -47,7 +49,10 @@ class Document foreach ($a as $item) { $page = $item['page'] + $offsetPage; - $item['url'] = Text::removeAccents($item['url']); + $item['url'] = trim(Text::removeAccents($item['url']), " '"); + if (!$item['url']) { + continue; + } foreach ($item as $k => $v) { if ($k == 'page') { continue; -- 2.39.5