diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php
index 85d3f1967e9..1957f2c820d 100644
--- a/htdocs/core/lib/website.lib.php
+++ b/htdocs/core/lib/website.lib.php
@@ -614,7 +614,7 @@ function dolSavePageContent($filetpl, $object, $objectpage)
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
- $tplcontent.= ''."\n";
+ $tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= '/ims\', \'\', file_get_contents(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")); ?>'."\n";
$tplcontent.= ''."\n";
diff --git a/htdocs/public/website/styles.css.php b/htdocs/public/website/styles.css.php
index 674651f9e29..3e2462d889c 100644
--- a/htdocs/public/website/styles.css.php
+++ b/htdocs/public/website/styles.css.php
@@ -85,7 +85,7 @@ if (empty($pageid))
$objectpage=new WebsitePage($db);
$array=$objectpage->fetchAll($object->id);
- if (count($array) > 0)
+ if (is_array($array) && count($array) > 0)
{
$firstrep=reset($array);
$pageid=$firstrep->id;