01394: UTF-8 breaks DIV markup processing

Summary: UTF-8 breaks DIV markup processing
Created: 2016-09-06 07:07
Status: Closed - not a bug
Category: Cookbook
From: Finar
Assigned:
Priority: 3
Version: 2.2.90
OS: php 5.2.17

Description:


Adding this code to config.php:

include_once("scripts/xlpage-utf-8.php");

causes this wiki-code:

>>red<<123456789ABCDEFGHI
test
>><<
123456789ABCDEFGHI

test

to break the page rendering. Page content just completely stops generating.

The problem is in the length of "123456789ABCDEFGHI", after deleting any character it starts working.


Finar September 06, 2016, at 07:08 AM

>>red<<123456789ABCDEFGHI123456789ABCDEFGHI12 456789ABCDEFGH I12345678 9ABCDEFGH I123456789A BCDEFGHI
test
>><<
123456789ABCDEFGHI123456789ABCDEFGHI12 456789ABCDEFGH I12345678 9ABCDEFGH I123456789A BCDEFGHI

test

UTF-8 is enabled on this page, and as you can see there are no problems here. I suggest you look into any recipes that call the function htmlspecialchars and replace them with PHSC(), see Troubleshooting#blank_sections. --Petko September 06, 2016, at 07:28 AM


Thank you, Petko! The problem is in EnableHTML recipe, code from this block causes described problem:

Same code as presented, but this one works with linebreaks enabled in config.php (e.g. $HTMLPNewline = '<br />'; ) and allows all html tags:

Can you suggest how to fix it?

Finar September 07, 2016, at 05:55 AM

Leave a space or a new line after the >>red<< part, otherwise the EnableHTML recipe thinks that <123... up to the first > is a HTML tag and outputs it unchanged. --Petko September 07, 2016, at 10:11 AM