Cotonti / Cotonti

Fast, reliable and flexible PHP CMF/CMS
https://www.cotonti.com
BSD 3-Clause "New" or "Revised" License
92 stars 51 forks source link

When creating or editing page '<' replaced with &lt in page description and displayed incorrectly #1765

Closed Kabak closed 5 months ago

Kabak commented 5 months ago

{PAGE_DESC} teg problem

page.functions.php

strings 298 - 304

                htmlspecialchars($page_data['user_name']) : '',
            'DESC' => (isset($page_data['page_desc']) && $page_data['page_desc'] != '') ?
                htmlspecialchars($page_data['page_desc']) : '',
            'DESC_OR_TEXT' => (isset($page_data['page_desc']) && $page_data['page_desc'] != '') ?
                htmlspecialchars($page_data['page_desc']) : $text,
            'DESC_OR_TEXT_CUT' => (isset($page_data['page_desc']) && $page_data['page_desc'] != '') ?
                htmlspecialchars($page_data['page_desc']) : $text_cut,

seems should be

            'DESC' => (isset($page_data['page_desc']) && $page_data['page_desc'] != '') ?
                $page_data['page_desc'] : '',
            'DESC_OR_TEXT' => (isset($page_data['page_desc']) && $page_data['page_desc'] != '') ?
                $page_data['page_desc'] : $text,
            'DESC_OR_TEXT_CUT' => (isset($page_data['page_desc']) && $page_data['page_desc'] != '') ?
                $page_data['page_desc'] : $text_cut,
Alex300 commented 5 months ago

See https://github.com/Cotonti/Cotonti/issues/1763

This is not a bug. Page description is plain text field and it should be processed by htmlspecialchars() before output

Снимок экрана 2024-01-23 122126

Снимок экрана 2024-01-23 121847

Kabak commented 5 months ago

Why forum theme description not treat the same way as page description ?

Alex300 commented 5 months ago

There are page screenshots in the post above. see one more time: https://github.com/Cotonti/Cotonti/issues/1763 )))

Fixed with: https://github.com/Cotonti/Cotonti/commit/38325cc5c280961684036ccf3f610d40858b4de9

Just try fresh version from master brunch.

Alex300 commented 5 months ago

Try to edit page or create a new one after code update. It shoult work. I cant reproduce this issue.

Kabak commented 5 months ago

forums.sections.php & forums.topics.php still have a problem

https://i.gyazo.com/5d1c5c459c2d38f561cf3679811469f1.png https://i.gyazo.com/14fdf6c50e562f4eb3d8c074160f4d33.png

Alex300 commented 5 months ago

Please try now

Kabak commented 5 months ago

forums.sections.php & forums.topics.php still have a problem

Alex300 commented 5 months ago

If it is nof fixed with last commit (https://github.com/Cotonti/Cotonti/commit/c4a231613588f2b4fea430cb008848a716510119). Can you please provide more info. Template and tag names. I can't reproduce it.

Снимок экрана 2024-01-24 204000

Снимок экрана 2024-01-24 195739

Снимок экрана 2024-01-24 195759

Kabak commented 5 months ago

forums.sections.tpl {FORUMS_SECTIONS_ROW_LASTPOST}

forums.topics.tpl {FORUMS_TOPICS_ROW_TITLE} , {FORUMS_TOPICS_ROW_DESC}