count blank header as null

This commit is contained in:
Shish 2017-08-24 10:17:39 +01:00
parent 473c0f0bcb
commit abe473ffd6

View file

@ -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));
}
/**