Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List parse error #412

Closed
zerbbi opened this issue Jul 28, 2016 · 6 comments
Closed

List parse error #412

zerbbi opened this issue Jul 28, 2016 · 6 comments

Comments

@zerbbi
Copy link

zerbbi commented Jul 28, 2016

Hello, i found problems when using (un)ordered lists. Parser is rendering weird characters when using special characters like č ž ť. When i remove list, text is rendered correctly. Here is screenshot, input is on the left half of picture and result is on the right. I found that this issue is related with substr_replace. I changed code in vendor/erusev/parsedown/Parsedown.php on line 1461 to $markup = substr($markup, 0, $position - strlen($markup)); and now, everything is working. Also this problem happens only when server is having set mbstring.func_overload = 7

test text:

* test
* hocičo
* assasasss
* lorem ipsum
* kúsky čriev
* hocičo

screenshot: markdown_problem

@erusev
Copy link
Owner

erusev commented Jul 28, 2016

can u reproduce this on http://parsedown.org/demo

@zerbbi
Copy link
Author

zerbbi commented Jul 28, 2016

it is working correctly in demo, this bug only happens when server has mbstring.func_overload set to 7.

@erusev
Copy link
Owner

erusev commented Jul 28, 2016

i'm not familiar with that server configuration

@ziqbal
Copy link

ziqbal commented Jul 28, 2016

@Zegnat
Copy link

Zegnat commented Aug 14, 2016

Several security libraries have had problems with this, as strlen suddenly would not work as a binary counter anymore. The fix is relatively easy and if you know what functions are causing the problem in ParseDown those could easily be patched.

See this patch on the password_compat library: #40 diff line 220.

@Zegnat
Copy link

Zegnat commented Aug 15, 2016

Actually, this is a duplicate of #378 and the final comment features the same fix as mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants