diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-01-29 22:40:41 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-01-29 22:40:41 +0000 |
commit | 1df3cfffefefc93ed2d29041d148938d08bb9d4e (patch) | |
tree | 3f2488086535e8ce70f656f32113dd6eef4fd545 /includes/file.inc | |
parent | 139f4375615216dfd077caba957508ff60778f45 (diff) | |
download | brdo-1df3cfffefefc93ed2d29041d148938d08bb9d4e.tar.gz brdo-1df3cfffefefc93ed2d29041d148938d08bb9d4e.tar.bz2 |
- Patch #284899 by c960657, voxpelli, mattconnolly: fixed Drupal url problem with clean urls.
Diffstat (limited to 'includes/file.inc')
-rw-r--r-- | includes/file.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/file.inc b/includes/file.inc index 6395c6323..ccac9cabc 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -901,6 +901,10 @@ function file_unmunge_filename($filename) { * of $basename. */ function file_create_filename($basename, $directory) { + // Strip control characters (ASCII value < 32). Though these are allowed in + // some filesystems, not many applications handle them well. + $basename = preg_replace('/[\x00-\x1F]/u', '_', $basename); + // A URI or path may already have a trailing slash or look like "public://". if (substr($directory, -1) == '/') { $separator = ''; |