Mini FrontPage - missing letters
- Posted by Tobiasz Kiszlo (6) Offline
Sorry, was visiting my family this weekend.
You can have it, just let me know where to send it - announcing it here wouldn't be wise thing I guess.
11 years 11 months ago #7
by Tobiasz Kiszlo
You can have it, just let me know where to send it - announcing it here wouldn't be wise thing I guess.
Please Log in or Create an account to join the conversation.
- Posted by Tobiasz Kiszlo (6) Offline
- Posted by Tobiasz Kiszlo (6) Offline
Yesterday I decided to do it all over again. Installed Joomla, plugins and put some articles. The same thing happened. So I sat down, opened some 'php for dummies' sites and I've been trying to find out what was going on.
Apparently there's problem with polish characters (ąćęłńóśźż).
I found that this part of fix_tags function was the source of problem:
$result .= $matches[1];
$html = mb_substr($html, strlen($matches[0]));
It appears that in $matches[0], polish characters were counted double (perhaps codepage issue) - so the more polish characters before tag, the more characters were deleted right after tag.
I changed it this way:
$result .= $matches[1];
$toob = stristr($html, ">");
$html = mb_substr($toob, 1);
Now it seems to work but I'm not familiar with php so I guess it might cause some other issues and could be done far better. I'm sure I won't be using '>' in text so it will always be html tag (I know it would mess up pretty well if I used it).
Please let me know if you think there's better solution.
11 years 10 months ago #9
by Tobiasz Kiszlo
Apparently there's problem with polish characters (ąćęłńóśźż).
I found that this part of fix_tags function was the source of problem:
$result .= $matches[1];
$html = mb_substr($html, strlen($matches[0]));
It appears that in $matches[0], polish characters were counted double (perhaps codepage issue) - so the more polish characters before tag, the more characters were deleted right after tag.
I changed it this way:
$result .= $matches[1];
$toob = stristr($html, ">");
$html = mb_substr($toob, 1);
Now it seems to work but I'm not familiar with php so I guess it might cause some other issues and could be done far better. I'm sure I won't be using '>' in text so it will always be html tag (I know it would mess up pretty well if I used it).
Please let me know if you think there's better solution.
Please Log in or Create an account to join the conversation.
- Posted by andy (759) Offline
Hi Toobkin, I'm not really sure whether this will have any impact to other part or not, but basically you can use that code.
11 years 10 months ago #10
by andy
Please Log in or Create an account to join the conversation.