Character failure / cutoff
btopro - July 15, 2008 - 18:46
| Project: | Outline Designer |
| Version: | 5.x-1.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
Description
Entering Microsoft characters (aka illegal chars) will crash the outline designer. It won't hurt any data, it just won't open any outline that has illegal characters in the title (like the funny Word quotation marks).
Also, characters aren't escaped correctly with single and double slashes which can cause titles to get cut off in some rare instances of using funny characters in Drupal titles.

#1
I have found the reason for this bug. But I don't know how to solve it.
The problem is that outline designer uses serialize function to pass the info to the js script.
When a string have non ascii - 128 characters serialize prints something like this.
<?phpprint serialize("mono"); //Display s:4:"mono";
print serialize("moño"); //Display s:5:"moño";
?>
If we use unserialize to get the original string, all words are unserialized correctly
The problems is that javascript file uses PHP_Unserialize to get the original string and it doesn't take care about the diference of lengths
I think that the solution is use drupal_to_js instead of print serialize but this implies rewrite a lot of code.
#2
Very true. I've recently fixed this issue in the Drupal 6 version but it was a total rewrite of...everything and I have no plans of going back and supporting the 5 version beyond what it is currently as we're upgrading everything to 6 for spring semester.
#3
Moving on to D6, it's a total rewrite and I can't back-port anything. Doesn't matter though because this is no longer an issue in the 6 version.