From 18cf4e7c0ad5be1b5f0e03bcbdad7907c47d5313 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 6 May 2025 12:56:09 +0900 Subject: [PATCH 01/17] Add origin module_srl to $oDocument in dispBoardWrite --- modules/board/board.view.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 06b6077ff..be8e372cc 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -913,6 +913,7 @@ class BoardView extends Board $oDocument->setDocument($document_srl); $savedDoc = ($oDocument->get('module_srl') == $oDocument->get('member_srl')); + $oDocument->add('origin_module_srl', $oDocument->get('module_srl')); $oDocument->add('module_srl', $this->module_srl); if($oDocument->isExists()) From a7f32afb214fe53e68ccdd9b3d689b02132399eb Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 11 May 2025 01:10:30 +0900 Subject: [PATCH 02/17] Normalize whitespace --- modules/counter/counter.admin.view.php | 2 +- modules/counter/counter.class.php | 6 +++--- modules/counter/counter.controller.php | 14 +++++++------- modules/counter/counter.model.php | 12 ++++++------ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/counter/counter.admin.view.php b/modules/counter/counter.admin.view.php index ccfb9f1a5..9d50b1b3e 100644 --- a/modules/counter/counter.admin.view.php +++ b/modules/counter/counter.admin.view.php @@ -21,7 +21,7 @@ class counterAdminView extends counter } /** - * Admin page + * Admin page * * @return Object */ diff --git a/modules/counter/counter.class.php b/modules/counter/counter.class.php index f6aa96ddc..4038ac3dd 100644 --- a/modules/counter/counter.class.php +++ b/modules/counter/counter.class.php @@ -15,7 +15,7 @@ class counter extends ModuleObject */ function moduleInstall() { - + } /** @@ -30,7 +30,7 @@ class counter extends ModuleObject { return true; } - + return false; } @@ -55,7 +55,7 @@ class counter extends ModuleObject */ function recompileCache() { - + } } diff --git a/modules/counter/counter.controller.php b/modules/counter/counter.controller.php index f44724eeb..560eb951b 100644 --- a/modules/counter/counter.controller.php +++ b/modules/counter/counter.controller.php @@ -70,11 +70,11 @@ class counterController extends counter { $oDB = DB::getInstance(); $oDB->begin(); - + $args = new stdClass(); $args->regdate = [0, $date = date('Ymd')]; executeQuery('counter.updateCounterUnique', $args); - + $affected_rows = $oDB->getAffectedRows(); if ($affected_rows == 1) { @@ -88,9 +88,9 @@ class counterController extends counter $args->regdate = 0; executeQuery('counter.insertTodayStatus', $args); } - + $this->insertLog(); - + $oDB->commit(); } @@ -119,15 +119,15 @@ class counterController extends counter */ public function insertTotalStatus() { - + } - + /** * @deprecated */ public function deleteSiteCounterLogs() { - + } } /* End of file counter.controller.php */ diff --git a/modules/counter/counter.model.php b/modules/counter/counter.model.php index cab0307b8..8b3df2406 100644 --- a/modules/counter/counter.model.php +++ b/modules/counter/counter.model.php @@ -29,7 +29,7 @@ class counterModel extends counter { return true; } - + $args = new stdClass(); $args->regdate = $date; $args->ipaddress = \RX_CLIENT_IP; @@ -39,24 +39,24 @@ class counterModel extends counter { $_SESSION['counter_logged'][$date] = true; } - + return $iplogged; } /** - * Check if a row of today's counter status exists + * Check if a row of today's counter status exists * * @deprecated */ public static function isInsertedTodayStatus() { - + } /** * Get access statistics for a given date * - * @param mixed $selected_date Date(YYYYMMDD) list + * @param mixed $selected_date Date(YYYYMMDD) list * @return Object */ public static function getStatus($selected_date) @@ -212,7 +212,7 @@ class counterModel extends counter $status->max = $max; $status->sum = $sum; - + return $status; } From 80729f2aafcdf2988ea591f25051bc26a7cacfa1 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 11 May 2025 01:10:41 +0900 Subject: [PATCH 03/17] Fix undefined extra_vars in importer module --- modules/importer/importer.admin.controller.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index aa72feb56..74b2e4ec6 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -391,7 +391,7 @@ class importerAdminController extends importer $obj->signature = base64_decode($xmlObj->member->signature->body); $obj->regdate = base64_decode($xmlObj->member->regdate->body); $obj->last_login = base64_decode($xmlObj->member->last_login->body); - + $obj->extra_vars = new stdClass(); if($xmlObj->member->extra_vars) { foreach($xmlObj->member->extra_vars as $key => $val) @@ -426,10 +426,8 @@ class importerAdminController extends importer if(!$obj->last_login) $obj->last_login = $obj->regdate; // Set the list order $obj->list_order = -1 * $obj->member_srl; - // List extra vars - $extra_vars = $obj->extra_vars; - unset($obj->extra_vars); - $obj->extra_vars = serialize($extra_vars); + // Serialize extra vars + $obj->extra_vars = serialize($obj->extra_vars); // Check if the same user ID exists $args = new stdClass; $args->user_id = $obj->user_id; From b249df71b6c3806698e42c1b3c04e8cad0b6f5b9 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 11 May 2025 13:46:44 +0900 Subject: [PATCH 04/17] Fix #2550 incorrect handling of absolute URLs in imported SCSS files --- common/framework/Formatter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/framework/Formatter.php b/common/framework/Formatter.php index e06bd85a0..3d68eb3c9 100644 --- a/common/framework/Formatter.php +++ b/common/framework/Formatter.php @@ -453,8 +453,8 @@ class Formatter } if ($import_type === 'scss') { - $import_content = preg_replace('!//.*?\n!s', '', $import_content); - $import_content = preg_replace('![\r\n]+!', ' ', $import_content); + $import_content = preg_replace('@(? Date: Sun, 11 May 2025 13:47:14 +0900 Subject: [PATCH 05/17] Fix outdated codeception config directive --- codeception.dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codeception.dist.yml b/codeception.dist.yml index 66396a311..2662bb523 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -1,7 +1,7 @@ actor: Tester paths: tests: tests - log: tests/_output + output: tests/_output data: tests/_data helpers: tests/_support bootstrap: _bootstrap.php From 2ddf5aa8d8d363f072ef18b428e5767d41f1e9b8 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 11 May 2025 13:47:47 +0900 Subject: [PATCH 06/17] Update unit tests to cover situations like #2550 --- tests/_data/formatter/scss.target1.css | 3 +++ tests/_data/formatter/scss.target2.css | 2 +- tests/_data/formatter/scss/include1.scss | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/_data/formatter/scss.target1.css b/tests/_data/formatter/scss.target1.css index 3ac889792..e36d89525 100644 --- a/tests/_data/formatter/scss.target1.css +++ b/tests/_data/formatter/scss.target1.css @@ -4,6 +4,9 @@ .inc1 { margin: 5px; } +.inc1 > a[href^="https://rhymix.org/abc"] { + text-decoration: none; +} .inc2 { padding-left: 10px; } diff --git a/tests/_data/formatter/scss.target2.css b/tests/_data/formatter/scss.target2.css index 4e6968270..d9c7a0850 100644 --- a/tests/_data/formatter/scss.target2.css +++ b/tests/_data/formatter/scss.target2.css @@ -1,2 +1,2 @@ @charset "UTF-8"; -@import url("//fonts.googleapis.com/css?family=Raleway:700,400");@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap");.inc1{margin:5px}.inc2{padding-left:10px}.partial1{display:flex}.partial2{display:none}.rhymix{color:#123456;background:url("../_data/formatter/foo/bar.jpg")}.rhymix span{font-family:"테스트", Raleway, monospace;margin:320px}/*# sourceMappingURL=scss.target2.map */ +@import url("//fonts.googleapis.com/css?family=Raleway:700,400");@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap");.inc1{margin:5px}.inc1>a[href^="https://rhymix.org/abc"]{text-decoration:none}.inc2{padding-left:10px}.partial1{display:flex}.partial2{display:none}.rhymix{color:#123456;background:url("../_data/formatter/foo/bar.jpg")}.rhymix span{font-family:"테스트", Raleway, monospace;margin:320px}/*# sourceMappingURL=scss.target2.map */ diff --git a/tests/_data/formatter/scss/include1.scss b/tests/_data/formatter/scss/include1.scss index 1fa4276fc..c38661053 100644 --- a/tests/_data/formatter/scss/include1.scss +++ b/tests/_data/formatter/scss/include1.scss @@ -1,3 +1,6 @@ .inc1 { margin: $setting; + & > a[href^="https://rhymix.org/abc"] { + text-decoration:none; + } } From 087f5a22656bbf417f294fa46ed077d59f8ce01d Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 11 May 2025 22:57:38 +0900 Subject: [PATCH 07/17] Fix import error when email address is empty or invalid --- modules/importer/importer.admin.controller.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index 74b2e4ec6..27d4e29d8 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -416,7 +416,6 @@ class importerAdminController extends importer { $obj->email_address = $obj->user_id . '@example.com'; } - list($obj->email_id, $obj->email_host) = explode('@', $obj->email); // Set the mailing option if($obj->allow_mailing!='Y') $obj->allow_mailing = 'N'; // Set the message option @@ -453,9 +452,18 @@ class importerAdminController extends importer $obj->email_address = $obj->user_id . '@example.com'; } + list($obj->email_id, $obj->email_host) = explode('@', $obj->email_address); + if (!$obj->email_id) + { + $obj->email_id = ''; + } + if (!$obj->email_host) + { + $obj->email_host = ''; + } + // Add a member $output = executeQuery('member.insertMember', $obj); - if($output->toBool() && !($obj->password)) { // Send a mail telling the user to reset his password. From a1ae74837f2bacdfe52d56f8eca8d6ddb9e44c1c Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 12 May 2025 12:25:46 +0900 Subject: [PATCH 08/17] Fix incorrect return type when HTTP::download() cannot write to target file or parent directory --- common/framework/HTTP.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/framework/HTTP.php b/common/framework/HTTP.php index 5f38d3cb6..d0d39304d 100644 --- a/common/framework/HTTP.php +++ b/common/framework/HTTP.php @@ -91,7 +91,11 @@ class HTTP $target_dir = dirname($target_filename); if (!Storage::isDirectory($target_dir) && !Storage::createDirectory($target_dir)) { - return false; + return new Helpers\HTTPHelper(new Exception('Cannot create directory: ' . $target_dir)); + } + if (!Storage::isWritable($target_dir) && (!Storage::exists($target_filename) || !Storage::isWritable($target_filename))) + { + return new Helpers\HTTPHelper(new Exception('No permission to write file: ' . $target_filename)); } // Pass to request() with appropriate settings for the filename. From f55609eac8151906ea3543a6bdff173886ddbe2c Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 14 May 2025 00:23:54 +0900 Subject: [PATCH 09/17] Add syndication module to blacklist --- common/defaults/blacklist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/common/defaults/blacklist.php b/common/defaults/blacklist.php index cc0736e91..ad780a673 100644 --- a/common/defaults/blacklist.php +++ b/common/defaults/blacklist.php @@ -30,6 +30,7 @@ return array( 'homepage' => true, 'multidomain' => true, 'seo' => true, + 'syndication' => true, 'trackback' => true, ), From 5a867a3a8b46c10612d5b4672a45a6329984537a Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 14 May 2025 00:24:19 +0900 Subject: [PATCH 10/17] Add overflow-wrap: anywhere to .rhymix_content to prevent excessively long words from breaking layout --- common/css/rhymix.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/common/css/rhymix.scss b/common/css/rhymix.scss index a9b32fc53..d116b5b92 100644 --- a/common/css/rhymix.scss +++ b/common/css/rhymix.scss @@ -28,6 +28,7 @@ a img { } @else { word-break: $default_word_break; word-wrap: break-word; + overflow-wrap: anywhere; } p { margin: 0 0 $default_paragraph_spacing 0; From 833cf111bd67ebd7248db94633ca0fedeef5839d Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 14 May 2025 00:41:28 +0900 Subject: [PATCH 11/17] Enable editor components in mobile CKEditor --- modules/editor/skins/ckeditor/js/editor.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/editor/skins/ckeditor/js/editor.js b/modules/editor/skins/ckeditor/js/editor.js index ba888ee8a..261299067 100644 --- a/modules/editor/skins/ckeditor/js/editor.js +++ b/modules/editor/skins/ckeditor/js/editor.js @@ -87,7 +87,6 @@ $(function() { // Patch for iOS: https://github.com/rhymix/rhymix/issues/932 if (config.ios_patch) { - settings.loadXeComponent = false; $('head').append(' +@endif From 262560ce04f0a2bcbce5530b54af236893c4291a Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 14 May 2025 01:10:27 +0900 Subject: [PATCH 13/17] Add close buttons to all editor component popups, in case they are used in an iframe --- modules/editor/components/emoticon/tpl/popup.html | 1 + modules/editor/components/image_gallery/tpl/popup.html | 1 + modules/editor/components/image_link/tpl/popup.html | 1 + modules/editor/components/poll_maker/tpl/popup.html | 5 +++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/editor/components/emoticon/tpl/popup.html b/modules/editor/components/emoticon/tpl/popup.html index 95c57b8b1..48f4f0135 100644 --- a/modules/editor/components/emoticon/tpl/popup.html +++ b/modules/editor/components/emoticon/tpl/popup.html @@ -9,6 +9,7 @@

{$component_info->title}

+ ×
diff --git a/modules/editor/components/image_gallery/tpl/popup.html b/modules/editor/components/image_gallery/tpl/popup.html index 68fd4126d..6e806dc15 100644 --- a/modules/editor/components/image_gallery/tpl/popup.html +++ b/modules/editor/components/image_gallery/tpl/popup.html @@ -4,6 +4,7 @@ {@Context::addMetaTag('viewport', 'width=device-width', FALSE);}

{$component_info->title}

+ ×
diff --git a/modules/editor/components/image_link/tpl/popup.html b/modules/editor/components/image_link/tpl/popup.html index d11ed24ef..aa95bfbd7 100644 --- a/modules/editor/components/image_link/tpl/popup.html +++ b/modules/editor/components/image_link/tpl/popup.html @@ -4,6 +4,7 @@ {@Context::addMetaTag('viewport', 'width=device-width', FALSE);}

{$component_info->title}

+ ×
diff --git a/modules/editor/components/poll_maker/tpl/popup.html b/modules/editor/components/poll_maker/tpl/popup.html index 1778b0eba..eecdefea0 100644 --- a/modules/editor/components/poll_maker/tpl/popup.html +++ b/modules/editor/components/poll_maker/tpl/popup.html @@ -11,6 +11,7 @@

{$component_info->title}

+ ×
@@ -89,12 +90,12 @@
{$lang->poll_title}
- +
{$lang->poll_item} 1
- +
{$lang->poll_item} 2
From 71571817266fadef077c61d1ea20d3e33080b366 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 14 May 2025 02:13:04 +0900 Subject: [PATCH 14/17] Consolidate popup/iframe handling code in common areas --- common/js/common.js | 17 ++++++++++ common/tpl/popup_layout.html | 33 +++++++++++++++---- modules/editor/tpl/component_not_founded.html | 2 -- modules/editor/tpl/js/editor_common.js | 23 ++++--------- modules/editor/tpl/popup.html | 2 -- modules/editor/tpl/popup_iframe.blade.php | 15 --------- 6 files changed, 51 insertions(+), 41 deletions(-) delete mode 100644 modules/editor/tpl/popup_iframe.blade.php diff --git a/common/js/common.js b/common/js/common.js index 3eaba799b..307fdb088 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -737,6 +737,23 @@ function zbxe_folder_close(id) { jQuery("#folder_"+id).hide(); } +/** + * 팝업창 대신 전체 화면 iframe을 띄우는 함수 + */ +function openFullScreenIframe(url, target) { + const iframe = document.createElement('iframe'); + const iframe_sequence = String(Date.now()) + Math.round(Math.random() * 1000000); + iframe.setAttribute('id', '_rx_iframe_' + iframe_sequence); + iframe.setAttribute('name', target || ('_rx_iframe_' + iframe_sequence)) + iframe.setAttribute('src', url + '&iframe_sequence=' + iframe_sequence); + iframe.setAttribute('width', '100%'); + iframe.setAttribute('height', '100%'); + iframe.setAttribute('frameborder', '0'); + iframe.setAttribute('scrolling', 'no'); + iframe.setAttribute('style', 'position:fixed; top:0; left:0; width:100%; height:100%; z-index:999999999; background-color: #fff; overflow-y:auto'); + $(document.body).append(iframe); +} + /** * @brief 팝업의 경우 내용에 맞춰 현 윈도우의 크기를 조절해줌 * 팝업의 내용에 맞게 크기를 늘리는 것은... 쉽게 되지는 않음.. ㅡ.ㅜ diff --git a/common/tpl/popup_layout.html b/common/tpl/popup_layout.html index 3d1a8ff77..c6be2e6b4 100644 --- a/common/tpl/popup_layout.html +++ b/common/tpl/popup_layout.html @@ -1,12 +1,33 @@ @version(2) @load('../../modules/admin/tpl/css/admin.bootstrap.css') @load('../../modules/admin/tpl/css/admin.css') + - + +@if (isset($iframe_sequence) && preg_match('/^\w+$/', $iframe_sequence)) + + +@else + +@endif diff --git a/modules/editor/tpl/component_not_founded.html b/modules/editor/tpl/component_not_founded.html index bbbb13df7..2ce7608e1 100644 --- a/modules/editor/tpl/component_not_founded.html +++ b/modules/editor/tpl/component_not_founded.html @@ -1,5 +1,3 @@ - - - -@endif From d1d278719c2f267dd932a241afb4d7ac3259188d Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 14 May 2025 02:32:23 +0900 Subject: [PATCH 15/17] Also apply iframe solution to dispTempSavedList --- common/js/common.js | 11 ++++++++--- common/tpl/popup_layout.html | 3 +-- modules/document/tpl/saved_list_popup.html | 3 +++ modules/editor/tpl/popup.html | 2 -- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/common/js/common.js b/common/js/common.js index 307fdb088..7c9c5f2e5 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -947,7 +947,12 @@ var objForSavedDoc = null; function doDocumentLoad(obj) { // 저장된 게시글 목록 불러오기 objForSavedDoc = obj.form; - popopen(request_uri.setQuery('module','document').setQuery('act','dispTempSavedList')); + var popup_url = request_uri.setQuery('module','document').setQuery('act','dispTempSavedList'); + if (navigator.userAgent.match(/mobile/i)) { + openFullScreenIframe(popup_url); + } else { + popopen(popup_url); + } } /* 저장된 게시글의 선택 */ @@ -957,7 +962,7 @@ function doDocumentSelect(document_srl, module) { return; } - if(module===undefined) { + if(module === undefined) { module = 'document'; } @@ -978,7 +983,7 @@ function doDocumentSelect(document_srl, module) { opener.location.href = url; break; default : - opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite'); + opener.location.href = opener.current_url.setQuery('act', 'dispBoardWrite').setQuery('document_srl', document_srl); break; } window.close(); diff --git a/common/tpl/popup_layout.html b/common/tpl/popup_layout.html index c6be2e6b4..7de055796 100644 --- a/common/tpl/popup_layout.html +++ b/common/tpl/popup_layout.html @@ -18,8 +18,7 @@ }; diff --git a/modules/document/tpl/saved_list_popup.html b/modules/document/tpl/saved_list_popup.html index a894d7e30..59cbe43a5 100644 --- a/modules/document/tpl/saved_list_popup.html +++ b/modules/document/tpl/saved_list_popup.html @@ -1,6 +1,8 @@ {@Context::addMetaTag('viewport', 'width=device-width', FALSE);} +

{$lang->cmd_view_saved_document}

+ ×
@@ -41,6 +43,7 @@ {$lang->last_page} ›
+
diff --git a/modules/document/tpl/declare_document.html b/modules/document/tpl/declare_document.html index 77cd215e4..dfb3fa468 100644 --- a/modules/document/tpl/declare_document.html +++ b/modules/document/tpl/declare_document.html @@ -12,6 +12,7 @@

{$lang->improper_document_declare} {$lang->cmd_cancel}

+ ×
From 1d558204d114d0e6aee5f5dffb7c433b7053f263 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 14 May 2025 02:43:04 +0900 Subject: [PATCH 17/17] Also apply iframe solution to dispCommentDeclare etc. --- common/tpl/popup_layout.html | 12 ++++++++++-- modules/comment/tpl/declare_comment.html | 13 +++++++------ modules/member/tpl/spammer.html | 9 +++++---- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/common/tpl/popup_layout.html b/common/tpl/popup_layout.html index 27804868d..2378c2672 100644 --- a/common/tpl/popup_layout.html +++ b/common/tpl/popup_layout.html @@ -18,10 +18,18 @@ }; @else