[opw-web] Fix problem with attachments with periods in name
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [opw-web] Fix problem with attachments with periods in name
- Date: Tue, 18 Oct 2016 15:24:44 +0000 (UTC)
commit f6c05c0fc3cf5310ccc326d4787c82d0aea3f740
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Tue Oct 18 11:21:08 2016 -0400
Fix problem with attachments with periods in name
modules/mod_attachment.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/modules/mod_attachment.php b/modules/mod_attachment.php
index edfbc6a..834b283 100644
--- a/modules/mod_attachment.php
+++ b/modules/mod_attachment.php
@@ -135,7 +135,7 @@ if ($action == 'add') {
if ($error_message === '') {
$content_type = '';
$matches = null;
- if (preg_match('/\.(.*?)$/', $name, $matches)) {
+ if (preg_match('/\.([^.]*)$/', $name, $matches)) {
$extension = strtolower($matches[1]);
if ($extension == 'pdf')
$content_type = 'application/pdf';
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]