Vote #76342
未完了If user using customized theme with special characters in folder name, the generated stylesheet's URL won't be valid
0%
説明
I report this because the special case can cause error in my plugin, redmine_issue_reminder
h1. Overview Description:
If user use folder named "circle space" in redmine for customized theme, the generated page can use:
But not:
h1. href syntax : is it okay to have space in file name?
"HTML: href syntax : is it okay to have space in file name - Stack Overflow":http://stackoverflow.com/questions/4172579/html-href-syntax-is-it-okay-to-have-space-in-file-name
If user using customized theme with special characters in folder name, the generated stylesheet's URL is not valid
The href attribute should contain a valid URL[1]. Since space characters are not allowed[2] in URLs, you have to encode them[3].
h1. The Patch
The patch only escapes String but not Symbol, so it may be not a full solution.
h1. logs
sh: 1: svn: not found sh: 1: darcs: not found sh: 1: cvs: not found sh: 1: bzr: not found Environment: Redmine version 2.6.3.stable Ruby version 2.0.0-p598 (2014-11-13) [x86_64-linux] Rails version 3.2.21 Environment production Database adapter Mysql2 SCM: Mercurial 2.8.2 Git 1.9.1 Filesystem Redmine plugins: clipboard_image_paste 1.9 progressive_projects_list 1.0.0 redmine_bootstrap_kit 0.1 redmine_didyoumean 1.2.0 redmine_graphs 0.1.0 redmine_image_clipboard_paste 1.0.0 redmine_issue_reminder 3.0.0 redmine_issue_templates 0.1.0 redmine_keyboard_shortcuts 0.0.1 redmine_lightbox 0.0.8 redmine_stealth 0.6.0 redmine_zenedit 0.0.2 scrum 0.9.1 sidebar_hide 0.0.7
fn1. http://en.wikipedia.org/wiki/URL#Syntax
fn2. http://stackoverflow.com/questions/497908/are-urls-allowed-to-have-a-space-in-them
journals
* Typo about my plugin, it's http://www.redmine.org/plugins/redmine_mail_reminder
* It Turns out the patch can cause other error. *DO NOT USE THE PATCH!!*
The problem is that Premailer uses URI to parse stylesheet file path, which errors when path has white space.
I have "Monkey-Patched Premailer":https://github.com/Hopebaytech/redmine_issue_reminder/commit/5628b3a789eb1c33d6dbd4916d6ea34cdbadd40b to use addressable/uri instead of native uri and it's fine now.
"My patch for Premailer/Premailer-rails"
However the issue still exists and currently there are no proper patch for this.
--------------------------------------------------------------------------------