Closed (fixed)
Project:
FlashVideo
Version:
6.x-1.5-rc4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2009 at 11:04 UTC
Updated:
4 Nov 2009 at 01:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
origo commentedI tracked down the problem. Basically it's a Unicode programming error. The problem occurs while parsing a [video] tag's parameters, when the node's body is encoded in UTF-8 and contains multibyte characters.
Specifically, the functions _flashvideo_replace_tags and _flashvideo_parse_params use a combination of strpos, explode, substr_replace (not Unicode aware) and drupal_strlen, drupal_substr (Unicode aware). The position found by strpos is incorrect when passed to drupal_substr, which causes the parameter parsing to fail. (Also things like incrementing a position by 1 may be wrong if the current character is multibyte.)
The solution should be to make sure all string functions are Unicode aware. I'm not sure what the best way to do that is, so I hope someone else more knowledgeable in PHP can fix this.
Comment #2
origo commentedComment #3
origo commentedI made an attempt to fix this issue using regular expression matching (inspired by the code in the Inline module). Here's a patch that works for me.
Comment #4
travist commentedGreat patch. I just committed this to the latest version. It will be in the version 1.5 release.
Thanks for your efforts.