This is kind of bizarre.
The self referencing [video] tag works well, but when used with node or index parameters, it displays "video not available". The bug happens only if the tag is preceded with more than 5 Cyrillic letters.
This works:
Some latin text
[video:node=100:index=0]
This falis:
Some измешан text
[video:node=100:index=0]
This works:
Некој miksed text
[video:node=100:index=0]
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | flash_mb3.patch | 2 KB | miopa |
| #6 | flash_mb2.patch | 3.56 KB | miopa |
| #2 | flash_mb.patch | 4.27 KB | miopa |
Comments
Comment #1
dmjossel commentedWell... crap. And here I am about to try and test this on a site with Russian as the default language...
Comment #2
miopa commentedThe bug comes from use of single-byte
strposandsubstr_replacefunctions on multi-byte strings.Because there is no multi-byte
substr_replacefunction built in PHP, I included in the patch one that I found in the User Contributed Notes on http://www.php.net/substr_replace.Comment #3
travist commentedDoes this work for non-multi-byte character configurations? Can anyone verify?
Comment #4
miopa commentedIt should work, the configuration is irrelevant, the affected functions apply to the body text. But i don't have any non utf-8 installation to check.
Comment #5
attheshow commentedAt first glance, this looks like a fairly lengthy function just to do string replacement. Is there really no existing method of doing this without maintaining our own custom function for it?
Comment #6
miopa commentedI noticed that I forgot to replace one occurrence of
substr_replace, so here is an update patch.Comment #7
miopa commentedI've analyzed the code and found a way to fix it without the added function. The thing is, I'm not sure if it's worse to maintain one extra function or this mash-up of single-byte and multi-byte string pointers that brings to memory the long forgotten horrors of C++.