From abe473ffd68ee0eb6370b613f34635413e689414 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 24 Aug 2017 10:17:39 +0100 Subject: [PATCH] count blank header as null --- core/block.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/block.class.php b/core/block.class.php index 8fe1bfbc..0fffb41f 100644 --- a/core/block.class.php +++ b/core/block.class.php @@ -66,7 +66,11 @@ class Block { $this->body = $body; $this->section = $section; $this->position = $position; - $this->id = preg_replace('/[^\w]/', '',str_replace(' ', '_', is_null($id) ? (is_null($header) ? md5($body) : $header) . $section : $id)); + + if(is_null($id)) { + $id = (empty($header) ? md5($body) : $header) . $section; + } + $this->id = preg_replace('/[^\w]/', '',str_replace(' ', '_', $id)); } /**