Comments (3)
I just tested Google Chrome additionally to Mozilla Firefox. Both are showing the same behaviour.
from phpmyfaq.
Hello. Mr. Thorsten
I am using it in the following environment.
・PHP 8.2
・phpMyFAQ 3.2.3
・Environmental settings Language Japanese
After I finish writing an article in Japanese using an editor, when I publish it, the article is only halfway through and is not displayed.
When I investigated,
https://symfony.com/doc/current/html_sanitizer.html#max-input-length
Max Input Length
In order to prevent DoS attacks, by default the HTML sanitizer limits the input length to 20000 characters (as measured by strlen($input)).
In HtmlSanitizer.php, it seems that the number of characters is counted using 'strlen'.
In src/phpMyFAQ/Helper/FaqHelper.php, it is counted by 'Strings::strlen'.
I expect that the problem will probably occur when using multi-byte characters when writing articles.
For now, in my environment, I have fixed it as follows.
Please use this as a reference for solving the problem.
--- FaqHelper.php.org 2023-12-18 10:09:25.675906766 +0900
+++ FaqHelper.php 2023-12-18 14:40:03.257403251 +0900
@@ -241,7 +241,8 @@ class FaqHelper extends Helper
*/
public function cleanUpContent(string $content): string
{
- $contentLength = Strings::strlen($content);
+ $contentLength = strlen($content);
$htmlSanitizer = new HtmlSanitizer(
(new HtmlSanitizerConfig())
->withMaxInputLength($contentLength + 1)
from phpmyfaq.
This is strange, because Strings::strlen() is just a wrapper for strlen() or, if the "mbstring" extension is available, we use mb_strlen() to avoid these multibyte issues.
@modelrailroader Is the fix for you working as well?
from phpmyfaq.
Related Issues (20)
- nightly 2024-07-04 / Possible error during online verification check HOT 1
- nightly 2024-07-04 / HTML code in contact field is not interpreted / paragraphs have no effect
- nightly 2024-07-04 / Activating Markdown Editor results in error when viewing FAQ HOT 1
- nightly 2024-07-04 / Config options not translated? HOT 1
- nightly 2024-07-04 / FAQ Content in Edit screen hidden HOT 2
- nightly 2024-07-04 / News items don't show up in frontend HOT 1
- nightly 2024-07-04 / Error when switching language from Edit Cat screen
- nightly 2024-07-04 / English categories seem not to save SERP fields
- nightly 2024-07-04 / Probably error saving comma in Tag field
- Remove pmf-notification and pmf-notification-error Toasts
- nightly 2024-07-05 / admin mail address in frontend-comment / modal doesn't close HOT 1
- Briefly explain Github download / to the right of the download dialog HOT 1
- nightly 2024-07-05 / Title of TAG page insufficient HOT 1
- nightly 2024-07-05 / title tag of GLOSSARY page is empty HOT 1
- nightly 2024-07-05 / Frontend visibility of GLOSSARY entries when changing language
- nightly 2024-07-05 / Title of SITEMAP page insufficient
- 3.2.7: Add Multisite HOT 2
- Error when trying to change a catergory HOT 2
- Date is always updated when editing an FAQ
- phpMyFAQ 3.2.8 throws Message: 'Call to a member function format() on null' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpmyfaq.