Merge lp:~wimleers/pressflow/hook_file_url_alter_bugfix into lp:pressflow
Proposed by
Wim Leers
Status: | Rejected |
---|---|
Rejected by: | David Strauss |
Proposed branch: | lp:~wimleers/pressflow/hook_file_url_alter_bugfix |
Merge into: | lp:pressflow |
Diff against target: |
73 lines (+8/-30) 1 file modified
includes/file.inc (+8/-30) |
To merge this branch: | bzr merge lp:~wimleers/pressflow/hook_file_url_alter_bugfix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Wim Leers (community) | Needs Resubmitting | ||
David Strauss | Needs Fixing | ||
Review via email: mp+39054@code.launchpad.net |
Description of the change
Includes the bugfixes for the bugs reported in https:/
Big thanks go to jcmarco, whose insight has uncovered flaws in my initial patch.
Note: the exact same code for file_create_url() is used in the CDN module's (http://
To post a comment you must log in.
This is a little silly:
> drupal_ substr( $path, 0, 1) == '/' || drupal_ substr( $path, 0, 2) == '//'
Anything that satisfies the latter condition inherently satisfies the former.
This confuses me:
> if (strpos($path, file_directory_ path() . '/') === 0) { file_directory_ path()) ), '\\/');
> $path = trim(substr($path, strlen(
> }
If we know $path begins with file_directory_ path() plus a slash, why would I set $path to the first N characters of itself, where N is the length of file_directory_ path()? It seems like that would set $path = trim(file_ directory_ path(), '\\/').
Finally, I don't see why the preg_match() should be case-insensitive, while other code (like the match I'm confused about above) is case-sensitive.