Hello,
There seems to be a problem when uploading sIFR font files with hyphens in the name. It looks like it creates a JavaScript variable based on the name of the font, and the hyphens cause an error since this is not an allowed character in JS variable names.
Example:
======================
Error: missing ; before statement
Source File: /sites/default/files/render/sifr3-rules.js?E
Line: 2, Column: 6
Source Code:
var sitesdefaultfilesrendersifr-tradegothic-boldswf = { src: '/sites/default/files/render/sifr-tradegothic-bold.swf' };
My recommendation would be to sanitize the font file name after upload and either delete anything not [A-Za-z0-9_] or replace it with an underscore.
I'd love to help, but I've never submitted a patch before....after this project is done I will give it a try (I'm on a tight deadline at the moment).
Thank you very much for providing this module.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 462544-hyphenated-font-file-names.patch | 763 bytes | xurizaemon |
Comments
Comment #1
cocoloco commentedComment #2
xurizaemonThe hyphenated font file name is probably fine. I stumbled on this one too, because the generated rule and then JS variable are also hyphenated, and the issue is that a JS variable named "dog-cat" is actually "dog minus cat".
It's just this line in sifr3.inc which shouldn't contain a hyphen -
Patch attached.
Comment #3
xurizaemonalways forget this bit ... gotta write myself a userscript for that
Comment #4
froboyI know it's an old issue, but just ran into this on a dev site (site-dev). I ran the patch, cleared both the render and site caches, and all is well. Changing to tested.