From 88577e1e977505323253e997efcfaceebdb3bcf6 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 3 Nov 2025 21:12:04 +0000 Subject: [PATCH] Fix encoding for webpage, layout and block title and body when editing - issue #1946 --- CHANGELOG | 3 +++ Zotlabs/Module/Editblock.php | 4 ++-- Zotlabs/Module/Editlayout.php | 4 ++-- Zotlabs/Module/Editwebpage.php | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4684b8602..683757ae7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -33,6 +33,9 @@ Hubzilla 10.6 (2025-??-??) - Code cleanup Bugfixes + - Fix encoding for webpage, layout and block title and body when editing - issue #1946 + - Fix issues which prevented files and photos to be updated correctly after rename via DAV + - Fix contact edit modal logic hijacking URL fragment on pages other than /connections - Fix deprecation notice in MessagesWidgetTest - Fix whole URL punified in mod follow - Fix whole URL punified in mod search diff --git a/Zotlabs/Module/Editblock.php b/Zotlabs/Module/Editblock.php index 1cbb1aee2..cb1a21a11 100644 --- a/Zotlabs/Module/Editblock.php +++ b/Zotlabs/Module/Editblock.php @@ -122,10 +122,10 @@ class Editblock extends \Zotlabs\Web\Controller { 'ptyp' => $itm[0]['type'], 'mimeselect' => true, 'mimetype' => $itm[0]['mimetype'], - 'body' => undo_post_tagging($content), + 'body' => htmlspecialchars_decode(undo_post_tagging($content), ENT_COMPAT), 'post_id' => $post_id, 'visitor' => true, - 'title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'), + 'title' => htmlspecialchars_decode($itm[0]['title'], ENT_COMPAT), 'placeholdertitle' => t('Title (optional)'), 'pagetitle' => $block_title, 'profile_uid' => (intval($channel['channel_id'])), diff --git a/Zotlabs/Module/Editlayout.php b/Zotlabs/Module/Editlayout.php index 1a3f5614c..8c1281c16 100644 --- a/Zotlabs/Module/Editlayout.php +++ b/Zotlabs/Module/Editlayout.php @@ -121,9 +121,9 @@ class Editlayout extends \Zotlabs\Web\Controller { 'hide_preview' => true, 'disable_comments' => true, 'ptyp' => $itm[0]['obj_type'], - 'body' => undo_post_tagging($itm[0]['body']), + 'body' => htmlspecialchars_decode(undo_post_tagging($itm[0]['body']), ENT_COMPAT), 'post_id' => $post_id, - 'title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'), + 'title' => htmlspecialchars_decode($itm[0]['title'], ENT_COMPAT), 'pagetitle' => $layout_title, 'ptlabel' => t('Layout Name'), 'placeholdertitle' => t('Layout Description (Optional)'), diff --git a/Zotlabs/Module/Editwebpage.php b/Zotlabs/Module/Editwebpage.php index ab4858d63..abe0adad8 100644 --- a/Zotlabs/Module/Editwebpage.php +++ b/Zotlabs/Module/Editwebpage.php @@ -144,7 +144,7 @@ class Editwebpage extends \Zotlabs\Web\Controller { 'hide_location' => true, 'hide_voting' => true, 'ptyp' => $itm[0]['type'], - 'body' => undo_post_tagging($content), + 'body' => htmlspecialchars_decode(undo_post_tagging($content), ENT_COMPAT), 'post_id' => $post_id, 'visitor' => ($is_owner) ? true : false, 'acl' => populate_acl($itm[0],false,\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')), @@ -154,7 +154,7 @@ class Editwebpage extends \Zotlabs\Web\Controller { 'mimeselect' => true, 'layout' => $layout, 'layoutselect' => true, - 'title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'), + 'title' => htmlspecialchars_decode($itm[0]['title'], ENT_COMPAT), 'lockstate' => (((strlen($itm[0]['allow_cid'])) || (strlen($itm[0]['allow_gid'])) || (strlen($itm[0]['deny_cid'])) || (strlen($itm[0]['deny_gid']))) ? 'lock' : 'unlock'), 'profile_uid' => (intval($owner)), 'bbcode' => (($mimetype == 'text/bbcode') ? true : false)