From 12a71b8a8bb01779d01bcc86d3c11efa334d660b Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Fri, 31 Mar 2023 11:50:03 +0200 Subject: [PATCH] Check if the google font is an array or not --- tarteaucitron.services.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 96fc34f..7682137 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -2961,11 +2961,20 @@ tarteaucitron.services.googlefonts = { return; } tarteaucitron.addScript('//ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', '', function () { - WebFont.load({ - google: { - families: tarteaucitron.user.googleFonts - } - }); + + if (tarteaucitron.user.googleFonts instanceof Array) { + WebFont.load({ + google: { + families: tarteaucitron.user.googleFonts + } + }); + } else { + WebFont.load({ + google: { + families: [tarteaucitron.user.googleFonts] + } + }); + } }); } };