Changes
This commit is contained in:
@@ -63,7 +63,7 @@ class CreatePost extends CreateRecord
|
|||||||
$rowData = $this->getFirstBlockByName('paragraph', $data['content']);
|
$rowData = $this->getFirstBlockByName('paragraph', $data['content']);
|
||||||
}
|
}
|
||||||
if ($rowData !== null) {
|
if ($rowData !== null) {
|
||||||
$description = strip_tags($rowData['data']['content']);
|
$description = html_entity_decode(strip_tags($rowData['data']['content']));
|
||||||
} else {
|
} else {
|
||||||
$description = null;
|
$description = null;
|
||||||
} $image = ($data['preview'] !== null) ? $data['preview'] : null;
|
} $image = ($data['preview'] !== null) ? $data['preview'] : null;
|
||||||
@@ -81,7 +81,7 @@ class CreatePost extends CreateRecord
|
|||||||
if ($rowData === null) {
|
if ($rowData === null) {
|
||||||
$rowData = $this->getFirstBlockByName('paragraph', $data['content']);
|
$rowData = $this->getFirstBlockByName('paragraph', $data['content']);
|
||||||
}
|
}
|
||||||
$preview_text = strip_tags($rowData['data']['content']);
|
$preview_text = html_entity_decode(strip_tags($rowData['data']['content']));
|
||||||
return Str::limit($preview_text, 160);
|
return Str::limit($preview_text, 160);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,7 +284,7 @@ class CreatePost extends CreateRecord
|
|||||||
case 'paragraph':
|
case 'paragraph':
|
||||||
// Удаляем все HTML-теги и заменяем закрывающие теги p и h2 на двойной отступ
|
// Удаляем все HTML-теги и заменяем закрывающие теги p и h2 на двойной отступ
|
||||||
$content = preg_replace('/<\/(p|h2)>/', "\n\n", $block['data']['content']);
|
$content = preg_replace('/<\/(p|h2)>/', "\n\n", $block['data']['content']);
|
||||||
$data .= strip_tags($content);
|
$data .= html_entity_decode(strip_tags($content));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'heading':
|
case 'heading':
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class EditPost extends EditRecord
|
|||||||
$rowData = $this->getFirstBlockByName('paragraph', $data['content']);
|
$rowData = $this->getFirstBlockByName('paragraph', $data['content']);
|
||||||
}
|
}
|
||||||
if ($rowData !== null) {
|
if ($rowData !== null) {
|
||||||
$preview_text = strip_tags($rowData['data']['content']);
|
$preview_text = html_entity_decode(strip_tags($rowData['data']['content']));
|
||||||
return Str::limit($preview_text, 160);
|
return Str::limit($preview_text, 160);
|
||||||
} else {
|
} else {
|
||||||
$preview_text = null;
|
$preview_text = null;
|
||||||
@@ -80,7 +80,7 @@ class EditPost extends EditRecord
|
|||||||
$rowData = $this->getFirstBlockByName('paragraph', $data['content']);
|
$rowData = $this->getFirstBlockByName('paragraph', $data['content']);
|
||||||
}
|
}
|
||||||
if ($rowData !== null) {
|
if ($rowData !== null) {
|
||||||
$description = strip_tags($rowData['data']['content']);
|
$description = html_entity_decode(strip_tags($rowData['data']['content']));
|
||||||
} else {
|
} else {
|
||||||
$description = null;
|
$description = null;
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ class EditPost extends EditRecord
|
|||||||
}
|
}
|
||||||
// Удаляем лишние пробелы и переносы строк
|
// Удаляем лишние пробелы и переносы строк
|
||||||
$result = preg_replace('/\s+/', ' ', $result);
|
$result = preg_replace('/\s+/', ' ', $result);
|
||||||
$result = trim($result);
|
$result = htmlspecialchars(trim($result));
|
||||||
|
|
||||||
return strtolower($result);
|
return strtolower($result);
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,7 @@ class EditPost extends EditRecord
|
|||||||
case 'paragraph':
|
case 'paragraph':
|
||||||
// Удаляем все HTML-теги и заменяем закрывающие теги p и h2 на двойной отступ
|
// Удаляем все HTML-теги и заменяем закрывающие теги p и h2 на двойной отступ
|
||||||
$content = preg_replace('/<\/(p|h2)>/', "\n\n", $block['data']['content']);
|
$content = preg_replace('/<\/(p|h2)>/', "\n\n", $block['data']['content']);
|
||||||
$data .= strip_tags($content);
|
$data .= html_entity_decode(strip_tags($content));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'heading':
|
case 'heading':
|
||||||
|
|||||||
Reference in New Issue
Block a user