Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
TEXTAREA 로 작성된 글을 에디터로 글 수정시 생기는 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Mar 19, 2018
1 parent b6489ff commit 8fadbed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions plugin/editor/cheditor5/editor.lib.php
Expand Up @@ -3,11 +3,17 @@

function editor_html($id, $content, $is_dhtml_editor=true)
{
global $config, $w, $board;
global $config, $w, $board, $write;
global $editor_width, $editor_height;
static $js = true;

if( $is_dhtml_editor && $content && !$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content']) ) ){ //글쓰기 기본 내용 처리
if(
$is_dhtml_editor && $content &&
(
(!$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content'])))
|| ($w == 'u' && isset($write['wr_option']) && strpos($write['wr_option'], 'html') === false )
)
){ //글쓰기 기본 내용 처리
if( preg_match('/\r|\n/', $content) && $content === strip_tags($content, '<a><strong><b>') ) { //textarea로 작성되고, html 내용이 없다면
$content = nl2br($content);
}
Expand Down
10 changes: 8 additions & 2 deletions plugin/editor/smarteditor2/editor.lib.php
Expand Up @@ -3,10 +3,16 @@

function editor_html($id, $content, $is_dhtml_editor=true)
{
global $g5, $config, $w, $board;
global $g5, $config, $w, $board, $write;
static $js = true;

if( $is_dhtml_editor && $content && !$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content']) ) ){ //글쓰기 기본 내용 처리
if(
$is_dhtml_editor && $content &&
(
(!$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content'])))
|| ($w == 'u' && isset($write['wr_option']) && strpos($write['wr_option'], 'html') === false )
)
){ //글쓰기 기본 내용 처리
if( preg_match('/\r|\n/', $content) && $content === strip_tags($content, '<a><strong><b>') ) { //textarea로 작성되고, html 내용이 없다면
$content = nl2br($content);
}
Expand Down

0 comments on commit 8fadbed

Please sign in to comment.